mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
eh hehehehehe, fire, FIRE!
This commit is contained in:
parent
19cfc54dee
commit
44b1604992
@ -22,4 +22,5 @@
|
||||
* Fixed landmines generating into the floor on superflat worlds
|
||||
* All NTM type explosions are no longer affected by difficulty setting, preventing them from dealing damage in peaceful mode
|
||||
* There are a few instances of vanilla explosions still being used, those will be phased out in the future
|
||||
* Fixed tutorial presentations triggering when hitting F1 not just in the inventory but also when looking at the block in question
|
||||
* Fixed tutorial presentations triggering when hitting F1 not just in the inventory but also when looking at the block in question
|
||||
* Fixed a bug regarding shift clicking in the breeding reactor
|
||||
110
src/main/java/com/hbm/commands/CommandReloadClient.java
Normal file
110
src/main/java/com/hbm/commands/CommandReloadClient.java
Normal file
@ -0,0 +1,110 @@
|
||||
package com.hbm.commands;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.hbm.config.ClientConfig;
|
||||
import com.hbm.config.ClientConfig.ConfigWrapper;
|
||||
|
||||
import cpw.mods.fml.relauncher.FMLLaunchHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.CommandException;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraftforge.client.ClientCommandHandler;
|
||||
|
||||
public class CommandReloadClient extends CommandBase {
|
||||
|
||||
public static void register() {
|
||||
if(FMLLaunchHandler.side() != Side.CLIENT) return;
|
||||
ClientCommandHandler.instance.registerCommand(new CommandReloadClient());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return "ntmclient";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender sender) {
|
||||
return "/ntmclient help";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCommandSenderUseCommand(ICommandSender sender) {
|
||||
return sender instanceof EntityPlayer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processCommand(ICommandSender sender, String[] args) {
|
||||
|
||||
if(args.length < 1) throw new CommandException(getCommandUsage(sender));
|
||||
|
||||
String operator = args[0];
|
||||
|
||||
if("help".equals(operator)) {
|
||||
sender.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "/ntmclient " + EnumChatFormatting.GOLD + "list"));
|
||||
sender.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "/ntmclient " + EnumChatFormatting.GOLD + "get " + EnumChatFormatting.RED + "<name>"));
|
||||
sender.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "/ntmclient " + EnumChatFormatting.GOLD + "set " + EnumChatFormatting.RED + "<name> <value>"));
|
||||
return;
|
||||
}
|
||||
|
||||
if("list".equals(operator)) {
|
||||
sender.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "CLIENT VARIABLES:"));
|
||||
for(Entry<String, ConfigWrapper> line : ClientConfig.configMap.entrySet()) {
|
||||
sender.addChatMessage(new ChatComponentText(" " + EnumChatFormatting.GOLD + line.getKey() + ": " + EnumChatFormatting.YELLOW + line.getValue().value));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if(args.length < 2) throw new CommandException(getCommandUsage(sender));
|
||||
|
||||
String key = args[1];
|
||||
|
||||
if("get".equals(operator)) {
|
||||
ConfigWrapper wrapper = ClientConfig.configMap.get(key);
|
||||
if(wrapper == null) throw new CommandException("Key does not exist.");
|
||||
sender.addChatMessage(new ChatComponentText(EnumChatFormatting.GOLD + key + ": " + EnumChatFormatting.YELLOW + wrapper.value));
|
||||
return;
|
||||
}
|
||||
|
||||
if(args.length < 3) throw new CommandException(getCommandUsage(sender));
|
||||
|
||||
String value = args[2];
|
||||
|
||||
if("set".equals(operator)) {
|
||||
ConfigWrapper wrapper = ClientConfig.configMap.get(key);
|
||||
if(wrapper == null) throw new CommandException("Key does not exist.");
|
||||
|
||||
try {
|
||||
wrapper.update(value);
|
||||
ClientConfig.refresh();
|
||||
sender.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "Value updated."));
|
||||
} catch(Exception ex) {
|
||||
throw new CommandException("Error parsing type for " + wrapper.value.getClass().getSimpleName() + ": " + ex.getLocalizedMessage());
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
throw new CommandException(getCommandUsage(sender));
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public List addTabCompletionOptions(ICommandSender sender, String[] args) {
|
||||
if(!(sender instanceof EntityPlayer)) return Collections.emptyList();
|
||||
if(args.length < 1) return Collections.emptyList();
|
||||
if(args.length == 1) return getListOfStringsMatchingLastWord(args, "list", "get", "set");
|
||||
String operator = args[0];
|
||||
if(args.length == 2 && ("get".equals(operator) || "set".equals(operator))) {
|
||||
return getListOfStringsFromIterableMatchingLastWord(args, ClientConfig.configMap.keySet().stream().map(String::valueOf).collect(Collectors.toList()));
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
@ -18,90 +18,78 @@ import java.util.Locale;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class CommandSatellites extends CommandBase {
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return "ntmsatellites";
|
||||
}
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return "ntmsatellites";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender iCommandSender) {
|
||||
return String.format(Locale.US,
|
||||
"%s/%s orbit %s- Launch the held satellite.\n" +
|
||||
"%s/%s descend <frequency> %s- Deletes satellite by frequency.\n"+
|
||||
"%s/%s list %s- Lists all active satellites.",
|
||||
EnumChatFormatting.GREEN, getCommandName(), EnumChatFormatting.LIGHT_PURPLE,
|
||||
EnumChatFormatting.GREEN, getCommandName(), EnumChatFormatting.LIGHT_PURPLE,
|
||||
EnumChatFormatting.GREEN, getCommandName(), EnumChatFormatting.LIGHT_PURPLE
|
||||
);
|
||||
}
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender iCommandSender) {
|
||||
return String.format(Locale.US, "%s/%s orbit %s- Launch the held satellite.\n" + "%s/%s descend <frequency> %s- Deletes satellite by frequency.\n" + "%s/%s list %s- Lists all active satellites.", EnumChatFormatting.GREEN, getCommandName(), EnumChatFormatting.LIGHT_PURPLE, EnumChatFormatting.GREEN, getCommandName(), EnumChatFormatting.LIGHT_PURPLE, EnumChatFormatting.GREEN, getCommandName(), EnumChatFormatting.LIGHT_PURPLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processCommand(ICommandSender sender, String[] args) {
|
||||
if(!(sender instanceof EntityPlayer)) {
|
||||
sender.addChatMessage(new ChatComponentTranslation( "commands.satellite.should_be_run_as_player").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
|
||||
return;
|
||||
}
|
||||
switch (args[0]) {
|
||||
case "orbit":
|
||||
EntityPlayer player = getCommandSenderAsPlayer(sender);
|
||||
if(player.getHeldItem().getItem() instanceof ISatChip && player.getHeldItem().getItem() != ModItems.sat_chip) {
|
||||
Satellite.orbit(
|
||||
player.worldObj,
|
||||
Satellite.getIDFromItem(player.getHeldItem().getItem()),
|
||||
ISatChip.getFreqS(player.getHeldItem()),
|
||||
player.posX, player.posY, player.posZ
|
||||
);
|
||||
player.getHeldItem().stackSize -= 1;
|
||||
sender.addChatMessage(new ChatComponentTranslation("commands.satellite.satellite_orbited").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN)));
|
||||
} else {
|
||||
sender.addChatMessage(new ChatComponentTranslation("commands.satellite.not_a_satellite").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
|
||||
}
|
||||
break;
|
||||
case "descend":
|
||||
int freq = parseInt(sender, args[1]);
|
||||
SatelliteSavedData data = SatelliteSavedData.getData(sender.getEntityWorld());
|
||||
if(data.sats.containsKey(freq)) {
|
||||
data.sats.remove(freq);
|
||||
data.markDirty();
|
||||
sender.addChatMessage(new ChatComponentTranslation( "commands.satellite.satellite_descended").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN)));
|
||||
} else {
|
||||
sender.addChatMessage(new ChatComponentTranslation( "commands.satellite.no_satellite").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
|
||||
}
|
||||
break;
|
||||
case "list":
|
||||
data = SatelliteSavedData.getData(sender.getEntityWorld());
|
||||
if (data.sats.isEmpty()) {
|
||||
ChatComponentTranslation message = new ChatComponentTranslation("commands.satellite.no_active_satellites");
|
||||
message.getChatStyle().setColor(EnumChatFormatting.RED);
|
||||
sender.addChatMessage(message);
|
||||
} else {
|
||||
data.sats.forEach((listFreq, sat) -> {
|
||||
String messageText = String.valueOf(listFreq) + " - " + sat.getClass().getSimpleName();
|
||||
ChatComponentText message = new ChatComponentText(messageText);
|
||||
message.getChatStyle().setColor(EnumChatFormatting.GREEN);
|
||||
sender.addChatMessage(message);
|
||||
});
|
||||
}
|
||||
break;
|
||||
@Override
|
||||
public void processCommand(ICommandSender sender, String[] args) {
|
||||
if(!(sender instanceof EntityPlayer)) {
|
||||
sender.addChatMessage(new ChatComponentTranslation("commands.satellite.should_be_run_as_player").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
|
||||
return;
|
||||
}
|
||||
switch(args[0]) {
|
||||
case "orbit":
|
||||
EntityPlayer player = getCommandSenderAsPlayer(sender);
|
||||
if(player.getHeldItem().getItem() instanceof ISatChip && player.getHeldItem().getItem() != ModItems.sat_chip) {
|
||||
Satellite.orbit(player.worldObj, Satellite.getIDFromItem(player.getHeldItem().getItem()), ISatChip.getFreqS(player.getHeldItem()), player.posX, player.posY, player.posZ);
|
||||
player.getHeldItem().stackSize -= 1;
|
||||
sender.addChatMessage(new ChatComponentTranslation("commands.satellite.satellite_orbited").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN)));
|
||||
} else {
|
||||
sender.addChatMessage(new ChatComponentTranslation("commands.satellite.not_a_satellite").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
|
||||
}
|
||||
break;
|
||||
case "descend":
|
||||
int freq = parseInt(sender, args[1]);
|
||||
SatelliteSavedData data = SatelliteSavedData.getData(sender.getEntityWorld());
|
||||
if(data.sats.containsKey(freq)) {
|
||||
data.sats.remove(freq);
|
||||
data.markDirty();
|
||||
sender.addChatMessage(new ChatComponentTranslation("commands.satellite.satellite_descended").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN)));
|
||||
} else {
|
||||
sender.addChatMessage(new ChatComponentTranslation("commands.satellite.no_satellite").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
|
||||
}
|
||||
break;
|
||||
case "list":
|
||||
data = SatelliteSavedData.getData(sender.getEntityWorld());
|
||||
if(data.sats.isEmpty()) {
|
||||
ChatComponentTranslation message = new ChatComponentTranslation("commands.satellite.no_active_satellites");
|
||||
message.getChatStyle().setColor(EnumChatFormatting.RED);
|
||||
sender.addChatMessage(message);
|
||||
} else {
|
||||
data.sats.forEach((listFreq, sat) -> {
|
||||
String messageText = String.valueOf(listFreq) + " - " + sat.getClass().getSimpleName();
|
||||
ChatComponentText message = new ChatComponentText(messageText);
|
||||
message.getChatStyle().setColor(EnumChatFormatting.GREEN);
|
||||
sender.addChatMessage(message);
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public List addTabCompletionOptions(ICommandSender sender, String[] args) {
|
||||
if(!(sender instanceof EntityPlayer)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if(args.length < 1) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if(args.length == 1) {
|
||||
return getListOfStringsMatchingLastWord(args, "orbit", "descend","list");
|
||||
}
|
||||
if (args[0].equals("descend")) {
|
||||
return getListOfStringsFromIterableMatchingLastWord(args, SatelliteSavedData.getData(sender.getEntityWorld()).sats.keySet().stream().map(String::valueOf).collect(Collectors.toList()));
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public List addTabCompletionOptions(ICommandSender sender, String[] args) {
|
||||
if(!(sender instanceof EntityPlayer)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if(args.length < 1) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if(args.length == 1) {
|
||||
return getListOfStringsMatchingLastWord(args, "orbit", "descend", "list");
|
||||
}
|
||||
if(args[0].equals("descend")) {
|
||||
return getListOfStringsFromIterableMatchingLastWord(args, SatelliteSavedData.getData(sender.getEntityWorld()).sats.keySet().stream().map(String::valueOf).collect(Collectors.toList()));
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.util;
|
||||
package com.hbm.commands;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.management.MonitorInfo;
|
||||
@ -21,8 +21,7 @@ public class SuicideThreadDump extends CommandBase {
|
||||
|
||||
public static void register() {
|
||||
if(FMLLaunchHandler.side() != Side.CLIENT) return;
|
||||
ClientCommandHandler handler = ClientCommandHandler.instance;
|
||||
handler.registerCommand(new SuicideThreadDump());
|
||||
ClientCommandHandler.instance.registerCommand(new SuicideThreadDump());
|
||||
}
|
||||
|
||||
@Override
|
||||
139
src/main/java/com/hbm/config/ClientConfig.java
Normal file
139
src/main/java/com/hbm/config/ClientConfig.java
Normal file
@ -0,0 +1,139 @@
|
||||
package com.hbm.config;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.main.MainRegistry;
|
||||
|
||||
// https://youtube.com/shorts/XTHZWqZt_AI
|
||||
public class ClientConfig {
|
||||
|
||||
public static final Gson gson = new Gson();
|
||||
public static HashMap<String, ConfigWrapper> configMap = new HashMap();
|
||||
|
||||
public static ConfigWrapper<Integer> GEIGER_OFFSET_HORIZONTAL = new ConfigWrapper(0);
|
||||
public static ConfigWrapper<Integer> GEIGER_OFFSET_VERTICAL = new ConfigWrapper(0);
|
||||
|
||||
private static void initDefaults() {
|
||||
configMap.put("GEIGER_OFFSET_HORIZONTAL", GEIGER_OFFSET_HORIZONTAL);
|
||||
configMap.put("GEIGER_OFFSET_VERTICAL", GEIGER_OFFSET_VERTICAL);
|
||||
}
|
||||
|
||||
public static void initConfig() {
|
||||
initDefaults();
|
||||
|
||||
File folder = MainRegistry.configHbmDir;
|
||||
File config = new File(folder.getAbsolutePath() + File.separatorChar + "hbmClient.json");
|
||||
if(config.exists()) readConfig(config);
|
||||
|
||||
refresh();
|
||||
}
|
||||
|
||||
public static void refresh() {
|
||||
|
||||
File folder = MainRegistry.configHbmDir;
|
||||
File config = new File(folder.getAbsolutePath() + File.separatorChar + "hbmClient.json");
|
||||
|
||||
writeConfig(config);
|
||||
}
|
||||
|
||||
private static void readConfig(File config) {
|
||||
|
||||
try {
|
||||
JsonObject json = gson.fromJson(new FileReader(config), JsonObject.class);
|
||||
HashMap<String, ConfigWrapper> newValues = new HashMap();
|
||||
|
||||
for(Entry<String, ConfigWrapper> line : configMap.entrySet()) {
|
||||
|
||||
if(json.has(line.getKey())) {
|
||||
JsonElement value = json.get(line.getKey());
|
||||
|
||||
try {
|
||||
|
||||
//world's shittiest dynamic type parser
|
||||
if(line.getValue().value instanceof String) newValues.put(line.getKey(), new ConfigWrapper(value.getAsString()));
|
||||
if(line.getValue().value instanceof Float) newValues.put(line.getKey(), new ConfigWrapper(value.getAsFloat()));
|
||||
if(line.getValue().value instanceof Double) newValues.put(line.getKey(), new ConfigWrapper(value.getAsDouble()));
|
||||
if(line.getValue().value instanceof Integer) newValues.put(line.getKey(), new ConfigWrapper(value.getAsInt()));
|
||||
if(line.getValue().value instanceof Boolean) newValues.put(line.getKey(), new ConfigWrapper(value.getAsBoolean()));
|
||||
|
||||
//gson doesn't give me the option to read the raw value of a JsonPrimitive so we have to this shit effectively twice
|
||||
//once to make sure that the parsed data matches with what's determined by the default,
|
||||
//and a second time in the ConfigWrapper to add ease of reading the data without needing manual casts
|
||||
|
||||
} catch(Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
configMap.putAll(newValues);
|
||||
|
||||
} catch(Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private static void writeConfig(File config) {
|
||||
|
||||
try {
|
||||
JsonWriter writer = new JsonWriter(new FileWriter(config));
|
||||
writer.setIndent(" ");
|
||||
writer.beginObject();
|
||||
|
||||
writer.name("info").value("This file can be edited ingame using the /ntmclient command.");
|
||||
|
||||
List<String> keys = new ArrayList();
|
||||
keys.addAll(configMap.keySet());
|
||||
Collections.sort(keys);
|
||||
|
||||
for(String key : keys) {
|
||||
|
||||
ConfigWrapper wrapper = configMap.get(key);
|
||||
Object value = wrapper.value;
|
||||
//this sucks and i am too stupid to come up with something better
|
||||
if(value instanceof String) writer.name(key).value((String) value);
|
||||
if(value instanceof Float) writer.name(key).value((Float) value);
|
||||
if(value instanceof Double) writer.name(key).value((Double) value);
|
||||
if(value instanceof Integer) writer.name(key).value((Integer) value);
|
||||
if(value instanceof Boolean) writer.name(key).value((Boolean) value);
|
||||
}
|
||||
|
||||
writer.endObject();
|
||||
writer.close();
|
||||
} catch(IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static class ConfigWrapper<T> {
|
||||
public T value;
|
||||
|
||||
public ConfigWrapper(T o) {
|
||||
this.value = o;
|
||||
}
|
||||
|
||||
public T get() { return value; }
|
||||
|
||||
public void update(String param) {
|
||||
Object stupidBufferObject = null; // wahh wahh can't cast Float to T wahh wahh shut the fuck up
|
||||
if(value instanceof String) stupidBufferObject = param;
|
||||
if(value instanceof Float) stupidBufferObject = Float.parseFloat(param);
|
||||
if(value instanceof Double) stupidBufferObject = Double.parseDouble(param);
|
||||
if(value instanceof Integer) stupidBufferObject = Integer.parseInt(param);
|
||||
if(value instanceof Boolean) stupidBufferObject = Boolean.parseBoolean(param);
|
||||
if(stupidBufferObject != null) this.value = (T) stupidBufferObject;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -140,7 +140,6 @@ public class WeaponRecipes {
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_immolator_ammo, 16), new Object[] { "SPS", "PCP", "SPS", 'S', STEEL.plate(), 'C', COAL.dust(), 'P', P_RED.dust() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_immolator_ammo, 16), new Object[] { " F ", "SFS", " F ", 'S', STEEL.plate(), 'F', Fluids.DIESEL.getDict(1000) });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_immolator_ammo, 24), new Object[] { " F ", "SFS", " F ", 'S', STEEL.plate(), 'F', ModItems.canister_napalm });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_flamer, 1), new Object[] { "WSS", "SCT", "WMI", 'W', GOLD.wireFine(), 'S', STEEL.pipe(), 'C', ModItems.coil_tungsten, 'T', ModItems.tank_steel, 'M', ModItems.mechanism_launcher_1, 'I', STEEL.ingot() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_cryolator, 1), new Object[] { "SSS", "IWL", "LMI", 'S', STEEL.plate(), 'I', IRON.plate(), 'L', Items.leather, 'M', ModItems.mechanism_launcher_1, 'W', AL.wireFine() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_cryolator_ammo, 16), new Object[] { "SPS", "PCP", "SPS", 'S', STEEL.plate(), 'C', KNO.dust(), 'P', Items.snowball });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_cryolator_ammo, 16), new Object[] { " F ", "SFS", " F ", 'S', STEEL.plate(), 'F', ModItems.powder_ice });
|
||||
|
||||
@ -86,7 +86,6 @@ public class EntityMappings {
|
||||
addEntity(EntityGrenadeASchrab.class, "entity_grenade_aschrab", 500);
|
||||
addEntity(EntityFalloutRain.class, "entity_fallout", 1000);
|
||||
addEntity(EntityEMPBlast.class, "entity_emp_blast", 1000);
|
||||
addEntity(EntityFire.class, "entity_fire", 1000);
|
||||
addEntity(EntityPlasmaBeam.class, "entity_immolator_beam", 1000);
|
||||
addEntity(EntityLN2.class, "entity_LN2", 1000);
|
||||
addEntity(EntityNightmareBlast.class, "entity_ominous_bullet", 1000);
|
||||
@ -105,7 +104,6 @@ public class EntityMappings {
|
||||
addEntity(EntityNukeExplosionMK3.class, "entity_nuke_mk3", 1000);
|
||||
addEntity(EntityVortex.class, "entity_vortex", 250);
|
||||
addEntity(EntityMeteor.class, "entity_meteor", 250);
|
||||
addEntity(EntityLaser.class, "entity_laser", 1000);
|
||||
addEntity(EntityBoxcar.class, "entity_boxcar", 1000);
|
||||
addEntity(EntityMissileTaint.class, "entity_missile_taint", 1000);
|
||||
addEntity(EntityGrenadeGascan.class, "entity_grenade_gascan", 1000);
|
||||
|
||||
@ -1,572 +0,0 @@
|
||||
package com.hbm.entity.projectile;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.explosion.ExplosionChaos;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IProjectile;
|
||||
import net.minecraft.entity.monster.EntityEnderman;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.play.server.S2BPacketChangeGameState;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityFire extends Entity implements IProjectile
|
||||
{
|
||||
private int field_145791_d = -1;
|
||||
private int field_145792_e = -1;
|
||||
private int field_145789_f = -1;
|
||||
public double gravity = 0.0D;
|
||||
private Block field_145790_g;
|
||||
private int inData;
|
||||
private boolean inGround;
|
||||
/** 1 if the player can pick up the arrow */
|
||||
public int canBePickedUp;
|
||||
/** Seems to be some sort of timer for animating an arrow. */
|
||||
public int arrowShake;
|
||||
/** The owner of this arrow. */
|
||||
public Entity shootingEntity;
|
||||
private int ticksInGround;
|
||||
private int ticksInAir;
|
||||
public int maxAge = 20;
|
||||
private double damage = 2.0D;
|
||||
/** The amount of knockback an arrow applies when it hits a mob. */
|
||||
private int knockbackStrength;
|
||||
public EntityFire(World p_i1753_1_)
|
||||
{
|
||||
super(p_i1753_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.setSize(0.5F, 0.5F);
|
||||
}
|
||||
|
||||
public EntityFire(World p_i1754_1_, double p_i1754_2_, double p_i1754_4_, double p_i1754_6_)
|
||||
{
|
||||
super(p_i1754_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.setSize(0.5F, 0.5F);
|
||||
this.setPosition(p_i1754_2_, p_i1754_4_, p_i1754_6_);
|
||||
this.yOffset = 0.0F;
|
||||
}
|
||||
|
||||
public EntityFire(World p_i1755_1_, EntityLivingBase p_i1755_2_, EntityLivingBase p_i1755_3_, float p_i1755_4_, float p_i1755_5_)
|
||||
{
|
||||
super(p_i1755_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.shootingEntity = p_i1755_2_;
|
||||
|
||||
if (p_i1755_2_ instanceof EntityPlayer)
|
||||
{
|
||||
this.canBePickedUp = 1;
|
||||
}
|
||||
|
||||
this.posY = p_i1755_2_.posY + p_i1755_2_.getEyeHeight() - 0.10000000149011612D;
|
||||
double d0 = p_i1755_3_.posX - p_i1755_2_.posX;
|
||||
double d1 = p_i1755_3_.boundingBox.minY + p_i1755_3_.height / 3.0F - this.posY;
|
||||
double d2 = p_i1755_3_.posZ - p_i1755_2_.posZ;
|
||||
double d3 = MathHelper.sqrt_double(d0 * d0 + d2 * d2);
|
||||
|
||||
if (d3 >= 1.0E-7D)
|
||||
{
|
||||
float f2 = (float)(Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F;
|
||||
float f3 = (float)(-(Math.atan2(d1, d3) * 180.0D / Math.PI));
|
||||
double d4 = d0 / d3;
|
||||
double d5 = d2 / d3;
|
||||
this.setLocationAndAngles(p_i1755_2_.posX + d4, this.posY, p_i1755_2_.posZ + d5, f2, f3);
|
||||
this.yOffset = 0.0F;
|
||||
float f4 = (float)d3 * 0.2F;
|
||||
this.setThrowableHeading(d0, d1 + f4, d2, p_i1755_4_, p_i1755_5_);
|
||||
}
|
||||
}
|
||||
|
||||
public EntityFire(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_)
|
||||
{
|
||||
super(p_i1756_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.shootingEntity = p_i1756_2_;
|
||||
|
||||
if (p_i1756_2_ instanceof EntityPlayer)
|
||||
{
|
||||
this.canBePickedUp = 1;
|
||||
}
|
||||
|
||||
this.setSize(0.5F, 0.5F);
|
||||
this.setLocationAndAngles(p_i1756_2_.posX, p_i1756_2_.posY + p_i1756_2_.getEyeHeight(), p_i1756_2_.posZ, p_i1756_2_.rotationYaw, p_i1756_2_.rotationPitch);
|
||||
this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F;
|
||||
this.posY -= 0.10000000149011612D;
|
||||
this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F;
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
this.yOffset = 0.0F;
|
||||
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI);
|
||||
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI);
|
||||
this.motionY = (-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI));
|
||||
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F);
|
||||
}
|
||||
|
||||
public EntityFire(World world, int x, int y, int z, double mx, double my, double mz, double grav) {
|
||||
super(world);
|
||||
this.posX = x + 0.5F;
|
||||
this.posY = y + 0.5F;
|
||||
this.posZ = z + 0.5F;
|
||||
|
||||
this.motionX = mx;
|
||||
this.motionY = my;
|
||||
this.motionZ = mz;
|
||||
|
||||
this.gravity = grav;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit()
|
||||
{
|
||||
this.dataWatcher.addObject(16, Byte.valueOf((byte)0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction.
|
||||
*/
|
||||
@Override
|
||||
public void setThrowableHeading(double p_70186_1_, double p_70186_3_, double p_70186_5_, float p_70186_7_, float p_70186_8_)
|
||||
{
|
||||
float f2 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_3_ * p_70186_3_ + p_70186_5_ * p_70186_5_);
|
||||
p_70186_1_ /= f2;
|
||||
p_70186_3_ /= f2;
|
||||
p_70186_5_ /= f2;
|
||||
p_70186_1_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_;
|
||||
p_70186_3_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_;
|
||||
p_70186_5_ += this.rand.nextGaussian() * (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * p_70186_8_;
|
||||
p_70186_1_ *= p_70186_7_;
|
||||
p_70186_3_ *= p_70186_7_;
|
||||
p_70186_5_ *= p_70186_7_;
|
||||
this.motionX = p_70186_1_;
|
||||
this.motionY = p_70186_3_;
|
||||
this.motionZ = p_70186_5_;
|
||||
float f3 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_5_ * p_70186_5_);
|
||||
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70186_1_, p_70186_5_) * 180.0D / Math.PI);
|
||||
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70186_3_, f3) * 180.0D / Math.PI);
|
||||
this.ticksInGround = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX,
|
||||
* posY, posZ, yaw, pitch
|
||||
*/
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_)
|
||||
{
|
||||
this.setPosition(p_70056_1_, p_70056_3_, p_70056_5_);
|
||||
this.setRotation(p_70056_7_, p_70056_8_);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the velocity to the args. Args: x, y, z
|
||||
*/
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_)
|
||||
{
|
||||
this.motionX = p_70016_1_;
|
||||
this.motionY = p_70016_3_;
|
||||
this.motionZ = p_70016_5_;
|
||||
|
||||
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
|
||||
{
|
||||
float f = MathHelper.sqrt_double(p_70016_1_ * p_70016_1_ + p_70016_5_ * p_70016_5_);
|
||||
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70016_1_, p_70016_5_) * 180.0D / Math.PI);
|
||||
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70016_3_, f) * 180.0D / Math.PI);
|
||||
this.prevRotationPitch = this.rotationPitch;
|
||||
this.prevRotationYaw = this.rotationYaw;
|
||||
this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
|
||||
this.ticksInGround = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to update the entity's position/logic.
|
||||
*/
|
||||
//@Override
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
super.onUpdate();
|
||||
|
||||
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
|
||||
{
|
||||
MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
|
||||
//this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f) * 180.0D / Math.PI);
|
||||
}
|
||||
|
||||
Block block = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||
|
||||
if (block.getMaterial() != Material.air)
|
||||
{
|
||||
block.setBlockBoundsBasedOnState(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||
AxisAlignedBB axisalignedbb = block.getCollisionBoundingBoxFromPool(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||
|
||||
if (axisalignedbb != null && axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ)))
|
||||
{
|
||||
this.inGround = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.arrowShake > 0)
|
||||
{
|
||||
--this.arrowShake;
|
||||
}
|
||||
|
||||
if (this.inGround)
|
||||
{
|
||||
this.setDead();
|
||||
int i = 3;
|
||||
if(!worldObj.isRemote) {
|
||||
ExplosionChaos.burn(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, i);
|
||||
ExplosionChaos.flameDeath(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, i * 2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
++this.ticksInAir;
|
||||
Vec3 vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
|
||||
Vec3 vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||
MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec31, vec3, false, true, false);
|
||||
vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ);
|
||||
vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||
|
||||
if (movingobjectposition != null)
|
||||
{
|
||||
vec3 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
|
||||
}
|
||||
|
||||
Entity entity = null;
|
||||
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
|
||||
double d0 = 0.0D;
|
||||
int i;
|
||||
float f1;
|
||||
|
||||
for (i = 0; i < list.size(); ++i)
|
||||
{
|
||||
Entity entity1 = (Entity)list.get(i);
|
||||
|
||||
if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5))
|
||||
{
|
||||
f1 = 0.3F;
|
||||
AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand(f1, f1, f1);
|
||||
MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3);
|
||||
|
||||
if (movingobjectposition1 != null)
|
||||
{
|
||||
double d1 = vec31.distanceTo(movingobjectposition1.hitVec);
|
||||
|
||||
if (d1 < d0 || d0 == 0.0D)
|
||||
{
|
||||
entity = entity1;
|
||||
d0 = d1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (entity != null)
|
||||
{
|
||||
movingobjectposition = new MovingObjectPosition(entity);
|
||||
}
|
||||
|
||||
if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.entityHit;
|
||||
|
||||
if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(entityplayer))
|
||||
{
|
||||
movingobjectposition = null;
|
||||
}
|
||||
}
|
||||
|
||||
float f2;
|
||||
float f4;
|
||||
|
||||
if (movingobjectposition != null)
|
||||
{
|
||||
if (movingobjectposition.entityHit != null)
|
||||
{
|
||||
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
|
||||
int k = MathHelper.ceiling_double_int(f2 * this.damage);
|
||||
|
||||
if (this.getIsCritical())
|
||||
{
|
||||
k += this.rand.nextInt(k / 2 + 2);
|
||||
}
|
||||
|
||||
DamageSource damagesource = null;
|
||||
|
||||
if (this.shootingEntity == null)
|
||||
{
|
||||
damagesource = DamageSource.generic;
|
||||
}
|
||||
else
|
||||
{
|
||||
damagesource = ModDamageSource.causeFireDamage(this, this.shootingEntity);
|
||||
}
|
||||
|
||||
if (!(movingobjectposition.entityHit instanceof EntityEnderman) && this.ticksExisted >= 5)
|
||||
{
|
||||
movingobjectposition.entityHit.setFire(10);
|
||||
}
|
||||
|
||||
if (movingobjectposition.entityHit.attackEntityFrom(damagesource, k))
|
||||
{
|
||||
if (movingobjectposition.entityHit instanceof EntityLivingBase)
|
||||
{
|
||||
EntityLivingBase entitylivingbase = (EntityLivingBase)movingobjectposition.entityHit;
|
||||
|
||||
if (this.knockbackStrength > 0)
|
||||
{
|
||||
f4 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
|
||||
if (f4 > 0.0F)
|
||||
{
|
||||
movingobjectposition.entityHit.addVelocity(this.motionX * this.knockbackStrength * 0.6000000238418579D / f4, 0.1D, this.motionZ * this.knockbackStrength * 0.6000000238418579D / f4);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.shootingEntity != null && this.shootingEntity instanceof EntityLivingBase)
|
||||
{
|
||||
EnchantmentHelper.func_151384_a(entitylivingbase, this.shootingEntity);
|
||||
EnchantmentHelper.func_151385_b((EntityLivingBase)this.shootingEntity, entitylivingbase);
|
||||
}
|
||||
|
||||
if (this.shootingEntity != null && movingobjectposition.entityHit != this.shootingEntity && movingobjectposition.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP)
|
||||
{
|
||||
((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(6, 0.0F));
|
||||
}
|
||||
}
|
||||
|
||||
if (!(movingobjectposition.entityHit instanceof EntityEnderman))
|
||||
{
|
||||
if (!this.worldObj.isRemote && movingobjectposition.entityHit instanceof EntityLivingBase)
|
||||
{
|
||||
movingobjectposition.entityHit.attackEntityFrom(damagesource, 5F);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.field_145791_d = movingobjectposition.blockX;
|
||||
this.field_145792_e = movingobjectposition.blockY;
|
||||
this.field_145789_f = movingobjectposition.blockZ;
|
||||
this.field_145790_g = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||
this.inData = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f);
|
||||
this.motionX = ((float)(movingobjectposition.hitVec.xCoord - this.posX));
|
||||
this.motionY = ((float)(movingobjectposition.hitVec.yCoord - this.posY));
|
||||
this.motionZ = ((float)(movingobjectposition.hitVec.zCoord - this.posZ));
|
||||
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
|
||||
this.posX -= this.motionX / f2 * 0.05000000074505806D;
|
||||
this.posY -= this.motionY / f2 * 0.05000000074505806D;
|
||||
this.posZ -= this.motionZ / f2 * 0.05000000074505806D;
|
||||
this.inGround = true;
|
||||
this.arrowShake = 7;
|
||||
this.setIsCritical(false);
|
||||
|
||||
if (this.field_145790_g.getMaterial() != Material.air)
|
||||
{
|
||||
this.field_145790_g.onEntityCollidedWithBlock(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.posX += this.motionX;
|
||||
this.posY += this.motionY;
|
||||
this.posZ += this.motionZ;
|
||||
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
|
||||
|
||||
f1 = 0.05F;
|
||||
|
||||
if (this.isInWater())
|
||||
{
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
if (this.isWet())
|
||||
{
|
||||
this.damage *= 0.8F;
|
||||
}
|
||||
|
||||
float f3 = 0.8F;
|
||||
this.motionX *= f3;
|
||||
this.motionY *= f3;
|
||||
this.motionZ *= f3;
|
||||
this.motionY -= gravity;
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
this.func_145775_I();
|
||||
}
|
||||
|
||||
if (this.ticksExisted > this.maxAge)
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||
*/
|
||||
@Override
|
||||
public void writeEntityToNBT(NBTTagCompound p_70014_1_)
|
||||
{
|
||||
p_70014_1_.setShort("xTile", (short)this.field_145791_d);
|
||||
p_70014_1_.setShort("yTile", (short)this.field_145792_e);
|
||||
p_70014_1_.setShort("zTile", (short)this.field_145789_f);
|
||||
p_70014_1_.setShort("life", (short)this.ticksInGround);
|
||||
p_70014_1_.setByte("inTile", (byte)Block.getIdFromBlock(this.field_145790_g));
|
||||
p_70014_1_.setByte("inData", (byte)this.inData);
|
||||
p_70014_1_.setByte("shake", (byte)this.arrowShake);
|
||||
p_70014_1_.setByte("inGround", (byte)(this.inGround ? 1 : 0));
|
||||
p_70014_1_.setByte("pickup", (byte)this.canBePickedUp);
|
||||
p_70014_1_.setDouble("damage", this.damage);
|
||||
}
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||
*/
|
||||
@Override
|
||||
public void readEntityFromNBT(NBTTagCompound p_70037_1_)
|
||||
{
|
||||
this.field_145791_d = p_70037_1_.getShort("xTile");
|
||||
this.field_145792_e = p_70037_1_.getShort("yTile");
|
||||
this.field_145789_f = p_70037_1_.getShort("zTile");
|
||||
this.ticksInGround = p_70037_1_.getShort("life");
|
||||
this.field_145790_g = Block.getBlockById(p_70037_1_.getByte("inTile") & 255);
|
||||
this.inData = p_70037_1_.getByte("inData") & 255;
|
||||
this.arrowShake = p_70037_1_.getByte("shake") & 255;
|
||||
this.inGround = p_70037_1_.getByte("inGround") == 1;
|
||||
|
||||
if (p_70037_1_.hasKey("damage", 99))
|
||||
{
|
||||
this.damage = p_70037_1_.getDouble("damage");
|
||||
}
|
||||
|
||||
if (p_70037_1_.hasKey("pickup", 99))
|
||||
{
|
||||
this.canBePickedUp = p_70037_1_.getByte("pickup");
|
||||
}
|
||||
else if (p_70037_1_.hasKey("player", 99))
|
||||
{
|
||||
this.canBePickedUp = p_70037_1_.getBoolean("player") ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by a player entity when they collide with an entity
|
||||
*/
|
||||
@Override
|
||||
public void onCollideWithPlayer(EntityPlayer p_70100_1_)
|
||||
{
|
||||
if (!this.worldObj.isRemote && this.inGround && this.arrowShake <= 0)
|
||||
{
|
||||
boolean flag = this.canBePickedUp == 1 || this.canBePickedUp == 2 && p_70100_1_.capabilities.isCreativeMode;
|
||||
|
||||
if (flag)
|
||||
{
|
||||
p_70100_1_.onItemPickup(this, 1);
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to
|
||||
* prevent them from trampling crops
|
||||
*/
|
||||
@Override
|
||||
protected boolean canTriggerWalking()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getShadowSize()
|
||||
{
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
public void setDamage(double p_70239_1_)
|
||||
{
|
||||
this.damage = p_70239_1_;
|
||||
}
|
||||
|
||||
public double getDamage()
|
||||
{
|
||||
return this.damage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the amount of knockback the arrow applies when it hits a mob.
|
||||
*/
|
||||
public void setKnockbackStrength(int p_70240_1_)
|
||||
{
|
||||
this.knockbackStrength = p_70240_1_;
|
||||
}
|
||||
|
||||
/**
|
||||
* If returns false, the item will not inflict any damage against entities.
|
||||
*/
|
||||
@Override
|
||||
public boolean canAttackWithItem()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the arrow has a stream of critical hit particles flying behind it.
|
||||
*/
|
||||
public void setIsCritical(boolean p_70243_1_)
|
||||
{
|
||||
byte b0 = this.dataWatcher.getWatchableObjectByte(16);
|
||||
|
||||
if (p_70243_1_)
|
||||
{
|
||||
this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1)));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -2)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the arrow has a stream of critical hit particles flying behind it.
|
||||
*/
|
||||
public boolean getIsCritical()
|
||||
{
|
||||
byte b0 = this.dataWatcher.getWatchableObjectByte(16);
|
||||
return (b0 & 1) != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getBrightnessForRender(float p_70070_1_)
|
||||
{
|
||||
return 15728880;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBrightness(float p_70013_1_)
|
||||
{
|
||||
return 1.0F;
|
||||
}
|
||||
}
|
||||
@ -1,95 +0,0 @@
|
||||
package com.hbm.entity.projectile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityLaser extends Entity {
|
||||
|
||||
public EntityLaser(World world) {
|
||||
super(world);
|
||||
this.ignoreFrustumCheck = true;
|
||||
}
|
||||
|
||||
public EntityLaser(World world, EntityPlayer player) {
|
||||
super(world);
|
||||
this.ignoreFrustumCheck = true;
|
||||
this.dataWatcher.updateObject(20, player.getDisplayName());
|
||||
|
||||
Vec3 vec = player.getLookVec();
|
||||
vec.rotateAroundY(-90F);
|
||||
float l = 0.25F;
|
||||
vec.xCoord *= l;
|
||||
vec.yCoord *= l;
|
||||
vec.zCoord *= l;
|
||||
|
||||
this.setPosition(player.posX + vec.xCoord, player.posY + player.getEyeHeight(), player.posZ + vec.zCoord);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
this.dataWatcher.addObject(20, "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
|
||||
if(this.ticksExisted > 1)
|
||||
this.setDead();
|
||||
|
||||
int range = 100;
|
||||
|
||||
EntityPlayer player = worldObj.getPlayerEntityByName(this.dataWatcher.getWatchableObjectString(20));
|
||||
|
||||
if(player != null) {
|
||||
|
||||
//this.setPosition(player.posX, player.posY + player.getEyeHeight(), player.posZ);
|
||||
|
||||
MovingObjectPosition pos = Library.rayTrace(player, range, 1);
|
||||
|
||||
//worldObj.createExplosion(this, pos.hitVec.xCoord, pos.hitVec.yCoord, pos.hitVec.zCoord, 1, false);
|
||||
|
||||
worldObj.spawnParticle("cloud", pos.hitVec.xCoord, pos.hitVec.yCoord, pos.hitVec.zCoord, 0, 0, 0);
|
||||
worldObj.playSound(pos.hitVec.xCoord, pos.hitVec.yCoord, pos.hitVec.zCoord, "random.fizz", 1, 1, true);
|
||||
|
||||
List<Entity> list = worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(pos.hitVec.xCoord - 1, pos.hitVec.yCoord - 1, pos.hitVec.zCoord - 1, pos.hitVec.xCoord + 1, pos.hitVec.yCoord + 1, pos.hitVec.zCoord + 1));
|
||||
|
||||
for(Entity e : list)
|
||||
e.attackEntityFrom(ModDamageSource.radiation, 5);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getBrightnessForRender(float p_70070_1_)
|
||||
{
|
||||
return 15728880;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBrightness(float p_70013_1_)
|
||||
{
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
}
|
||||
@ -43,8 +43,8 @@ public class ContainerMachineReactorBreeding extends Container {
|
||||
ItemStack stack = slot.getStack();
|
||||
var3 = stack.copy();
|
||||
|
||||
if(index <= 2) {
|
||||
if(!this.mergeItemStack(stack, 2, this.inventorySlots.size(), true)) {
|
||||
if(index <= 1) {
|
||||
if(!this.mergeItemStack(stack, 1, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@ -1587,7 +1587,6 @@ public class ModItems {
|
||||
public static Item gun_osipr_ammo2;
|
||||
public static Item gun_immolator;
|
||||
public static Item gun_immolator_ammo;
|
||||
public static Item gun_flamer;
|
||||
public static Item gun_cryolator;
|
||||
public static Item gun_cryocannon;
|
||||
public static Item gun_cryolator_ammo;
|
||||
@ -1634,6 +1633,7 @@ public class ModItems {
|
||||
public static Item gun_am180;
|
||||
public static Item gun_liberator;
|
||||
public static Item gun_congolake;
|
||||
public static Item gun_flamer;
|
||||
|
||||
public static Item ammo_standard;
|
||||
|
||||
@ -2408,24 +2408,6 @@ public class ModItems {
|
||||
public static Item orange6;
|
||||
public static Item orange7;
|
||||
public static Item orange8;
|
||||
/*public static Item gasflame1;
|
||||
public static Item gasflame2;
|
||||
public static Item gasflame3;
|
||||
public static Item gasflame4;
|
||||
public static Item gasflame5;
|
||||
public static Item gasflame6;
|
||||
public static Item gasflame7;
|
||||
public static Item gasflame8;*/
|
||||
public static Item flame_1;
|
||||
public static Item flame_2;
|
||||
public static Item flame_3;
|
||||
public static Item flame_4;
|
||||
public static Item flame_5;
|
||||
public static Item flame_6;
|
||||
public static Item flame_7;
|
||||
public static Item flame_8;
|
||||
public static Item flame_9;
|
||||
public static Item flame_10;
|
||||
public static Item ln2_1;
|
||||
public static Item ln2_2;
|
||||
public static Item ln2_3;
|
||||
@ -4153,8 +4135,7 @@ public class ModItems {
|
||||
gun_osipr_ammo2 = new Item().setUnlocalizedName("gun_osipr_ammo2").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_osipr_ammo2");
|
||||
gun_osipr = new ItemGunOSIPR(GunOSIPRFactory.getOSIPRConfig(), GunOSIPRFactory.getAltConfig()).setUnlocalizedName("gun_osipr").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_osipr");
|
||||
gun_immolator_ammo = new Item().setUnlocalizedName("gun_immolator_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_immolator_ammo");
|
||||
gun_immolator = new GunImmolator().setUnlocalizedName("gun_immolator").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_immolator");
|
||||
gun_flamer = new ItemGunBase(GunEnergyFactory.getFlamerConfig()).setUnlocalizedName("gun_flamer").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_flamer");
|
||||
gun_immolator = new Item().setUnlocalizedName("gun_immolator").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_immolator");
|
||||
gun_cryolator_ammo = new Item().setUnlocalizedName("gun_cryolator_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_cryolator_ammo");
|
||||
gun_cryolator = new GunCryolator().setUnlocalizedName("gun_cryolator").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_cryolator");
|
||||
gun_cryocannon = new ItemCryoCannon(GunEnergyFactory.getCryoCannonConfig()).setUnlocalizedName("gun_cryocannon").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_cryocannon");
|
||||
@ -5458,16 +5439,6 @@ public class ModItems {
|
||||
orange6 = new Item().setUnlocalizedName("orange6").setTextureName(RefStrings.MODID + ":orange6");
|
||||
orange7 = new Item().setUnlocalizedName("orange7").setTextureName(RefStrings.MODID + ":orange7");
|
||||
orange8 = new Item().setUnlocalizedName("orange8").setTextureName(RefStrings.MODID + ":orange8");
|
||||
flame_1 = new Item().setUnlocalizedName("flame_1").setTextureName(RefStrings.MODID + ":flame_1");
|
||||
flame_2 = new Item().setUnlocalizedName("flame_2").setTextureName(RefStrings.MODID + ":flame_2");
|
||||
flame_3 = new Item().setUnlocalizedName("flame_3").setTextureName(RefStrings.MODID + ":flame_3");
|
||||
flame_4 = new Item().setUnlocalizedName("flame_4").setTextureName(RefStrings.MODID + ":flame_4");
|
||||
flame_5 = new Item().setUnlocalizedName("flame_5").setTextureName(RefStrings.MODID + ":flame_5");
|
||||
flame_6 = new Item().setUnlocalizedName("flame_6").setTextureName(RefStrings.MODID + ":flame_6");
|
||||
flame_7 = new Item().setUnlocalizedName("flame_7").setTextureName(RefStrings.MODID + ":flame_7");
|
||||
flame_8 = new Item().setUnlocalizedName("flame_8").setTextureName(RefStrings.MODID + ":flame_8");
|
||||
flame_9 = new Item().setUnlocalizedName("flame_9").setTextureName(RefStrings.MODID + ":flame_9");
|
||||
flame_10 = new Item().setUnlocalizedName("flame_10").setTextureName(RefStrings.MODID + ":flame_10");
|
||||
ln2_1 = new Item().setUnlocalizedName("ln2_1").setTextureName(RefStrings.MODID + ":ln2_1");
|
||||
ln2_2 = new Item().setUnlocalizedName("ln2_2").setTextureName(RefStrings.MODID + ":ln2_2");
|
||||
ln2_3 = new Item().setUnlocalizedName("ln2_3").setTextureName(RefStrings.MODID + ":ln2_3");
|
||||
@ -7011,7 +6982,6 @@ public class ModItems {
|
||||
GameRegistry.registerItem(gun_xvl1456, gun_xvl1456.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_osipr, gun_osipr.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_immolator, gun_immolator.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_flamer, gun_flamer.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_cryolator, gun_cryolator.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_cryocannon, gun_cryocannon.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_fireext, gun_fireext.getUnlocalizedName());
|
||||
@ -7052,6 +7022,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(gun_am180, gun_am180.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_liberator, gun_liberator.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_congolake, gun_congolake.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_flamer, gun_flamer.getUnlocalizedName());
|
||||
|
||||
GameRegistry.registerItem(ammo_standard, ammo_standard.getUnlocalizedName());
|
||||
|
||||
@ -7872,16 +7843,6 @@ public class ModItems {
|
||||
GameRegistry.registerItem(orange6, orange6.getUnlocalizedName());
|
||||
GameRegistry.registerItem(orange7, orange7.getUnlocalizedName());
|
||||
GameRegistry.registerItem(orange8, orange8.getUnlocalizedName());
|
||||
GameRegistry.registerItem(flame_1, flame_1.getUnlocalizedName());
|
||||
GameRegistry.registerItem(flame_2, flame_2.getUnlocalizedName());
|
||||
GameRegistry.registerItem(flame_3, flame_3.getUnlocalizedName());
|
||||
GameRegistry.registerItem(flame_4, flame_4.getUnlocalizedName());
|
||||
GameRegistry.registerItem(flame_5, flame_5.getUnlocalizedName());
|
||||
GameRegistry.registerItem(flame_6, flame_6.getUnlocalizedName());
|
||||
GameRegistry.registerItem(flame_7, flame_7.getUnlocalizedName());
|
||||
GameRegistry.registerItem(flame_8, flame_8.getUnlocalizedName());
|
||||
GameRegistry.registerItem(flame_9, flame_9.getUnlocalizedName());
|
||||
GameRegistry.registerItem(flame_10, flame_10.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ln2_1, ln2_1.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ln2_2, ln2_2.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ln2_3, ln2_3.getUnlocalizedName());
|
||||
|
||||
@ -1,126 +0,0 @@
|
||||
package com.hbm.items.weapon;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.hbm.entity.projectile.EntityFire;
|
||||
import com.hbm.entity.projectile.EntityPlasmaBeam;
|
||||
import com.hbm.items.ModItems;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.entity.player.ArrowNockEvent;
|
||||
|
||||
public class GunImmolator extends Item {
|
||||
|
||||
Random rand = new Random();
|
||||
|
||||
public GunImmolator() {
|
||||
this.maxStackSize = 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumAction getItemUseAction(ItemStack par1ItemStack) {
|
||||
return EnumAction.bow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxItemUseDuration(ItemStack p_77626_1_) {
|
||||
return 72000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
|
||||
new ArrowNockEvent(p_77659_3_, p_77659_1_);
|
||||
{
|
||||
p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_));
|
||||
}
|
||||
|
||||
return p_77659_1_;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUsingTick(ItemStack stack, EntityPlayer player, int count) {
|
||||
World world = player.worldObj;
|
||||
|
||||
if (!player.isSneaking()) {
|
||||
boolean flag = player.capabilities.isCreativeMode
|
||||
|| EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0;
|
||||
if ((player.capabilities.isCreativeMode || player.inventory.hasItem(ModItems.gun_immolator_ammo))) {
|
||||
EntityFire entityarrow = new EntityFire(world, player, 3.0F);
|
||||
entityarrow.setDamage(6 + rand.nextInt(5));
|
||||
|
||||
if (flag) {
|
||||
entityarrow.canBePickedUp = 2;
|
||||
} else {
|
||||
if(count % 10 == 0)
|
||||
player.inventory.consumeInventoryItem(ModItems.gun_immolator_ammo);
|
||||
}
|
||||
|
||||
if(count == this.getMaxItemUseDuration(stack))
|
||||
world.playSoundAtEntity(player, "hbm:weapon.flamethrowerIgnite", 1.0F, 1F);
|
||||
if(count % 5 == 0)
|
||||
world.playSoundAtEntity(player, "hbm:weapon.flamethrowerShoot", 1.0F, 1F);
|
||||
|
||||
if (!world.isRemote) {
|
||||
world.spawnEntityInWorld(entityarrow);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
boolean flag = player.capabilities.isCreativeMode
|
||||
|| EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0;
|
||||
if ((player.capabilities.isCreativeMode || player.inventory.hasItem(ModItems.gun_immolator_ammo))) {
|
||||
|
||||
EntityPlasmaBeam plasma = new EntityPlasmaBeam(world, player, 1F);
|
||||
|
||||
if (flag) {
|
||||
plasma.canBePickedUp = 2;
|
||||
} else {
|
||||
if(count % 4 == 0)
|
||||
player.inventory.consumeInventoryItem(ModItems.gun_immolator_ammo);
|
||||
}
|
||||
|
||||
if(count == this.getMaxItemUseDuration(stack))
|
||||
world.playSoundAtEntity(player, "hbm:weapon.immolatorIgnite", 1.0F, 1F);
|
||||
if(count % 10 == 0)
|
||||
world.playSoundAtEntity(player, "hbm:weapon.immolatorShoot", 1.0F, 1F);
|
||||
|
||||
if (!world.isRemote)
|
||||
world.spawnEntityInWorld(plasma);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
|
||||
|
||||
list.add("Hold right mouse button");
|
||||
list.add("to shoot fire,");
|
||||
list.add("sneak to shoot");
|
||||
list.add("plasma beams!");
|
||||
list.add("");
|
||||
list.add("Ammo: Immolator Fuel");
|
||||
list.add("Damage: 5");
|
||||
list.add("Secondary Damage: 25 - 45");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Multimap getItemAttributeModifiers() {
|
||||
Multimap multimap = super.getItemAttributeModifiers();
|
||||
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
|
||||
new AttributeModifier(field_111210_e, "Weapon modifier", 4, 0));
|
||||
return multimap;
|
||||
}
|
||||
}
|
||||
@ -53,6 +53,7 @@ public class GunFactory {
|
||||
XFactory40mm.init();
|
||||
XFactory762mm.init();
|
||||
XFactory22lr.init();
|
||||
XFactoryFlamer.init();
|
||||
|
||||
/// PROXY BULLSHIT ///
|
||||
MainRegistry.proxy.registerGunCfg();
|
||||
@ -67,5 +68,6 @@ public class GunFactory {
|
||||
G12_BP, G12_BP_MAGNUM, G12_BP_SLUG, G12,
|
||||
R762_SP, R762_FMJ, R762_JHP, R762_AP, R762_DU,
|
||||
G40_FLARE, G40,
|
||||
FLAME_DIESEL,
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,6 +32,7 @@ public class GunFactoryClient {
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_am180, new ItemRenderAm180());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_liberator, new ItemRenderLiberator());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_congolake, new ItemRenderCongoLake());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_flamer, new ItemRenderFlamer());
|
||||
//PROJECTILES
|
||||
ammo_debug.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
ammo_debug_buckshot.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
|
||||
@ -77,6 +78,8 @@ public class GunFactoryClient {
|
||||
((ItemGunBaseNT) ModItems.gun_am180) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_liberator) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_congolake) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_flamer) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
|
||||
((ItemGunBaseNT) ModItems.gun_light_revolver_dani).getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY_MIRROR, LegoClient.HUD_COMPONENT_AMMO_MIRROR);
|
||||
((ItemGunBaseNT) ModItems.gun_light_revolver_dani).getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
}
|
||||
|
||||
@ -109,7 +109,7 @@ public class GunStateDecider {
|
||||
ItemGunBaseNT.setState(stack, gunIndex, GunState.COOLDOWN);
|
||||
ItemGunBaseNT.setTimer(stack, gunIndex, rec.getDelayAfterFire(stack));
|
||||
|
||||
player.worldObj.playSoundEffect(player.posX, player.posY, player.posZ, rec.getFireSound(stack), rec.getFireVolume(stack), rec.getFirePitch(stack));
|
||||
if(rec.getFireSound(stack) != null) player.worldObj.playSoundEffect(player.posX, player.posY, player.posZ, rec.getFireSound(stack), rec.getFireVolume(stack), rec.getFirePitch(stack));
|
||||
|
||||
int remaining = rec.getRoundsPerCycle(stack) - 1;
|
||||
for(int i = 0; i < remaining; i++) if(rec.getCanFire(stack).apply(stack, ctx)) rec.getOnFire(stack).accept(stack, ctx);
|
||||
|
||||
@ -74,7 +74,8 @@ public class Lego {
|
||||
if(rec.getCanFire(stack).apply(stack, ctx)) {
|
||||
rec.getOnFire(stack).accept(stack, ctx);
|
||||
|
||||
player.worldObj.playSoundEffect(player.posX, player.posY, player.posZ, rec.getFireSound(stack), rec.getFireVolume(stack), rec.getFirePitch(stack));
|
||||
if(rec.getFireSound(stack) != null)
|
||||
player.worldObj.playSoundEffect(player.posX, player.posY, player.posZ, rec.getFireSound(stack), rec.getFireVolume(stack), rec.getFirePitch(stack));
|
||||
|
||||
int remaining = rec.getRoundsPerCycle(stack) - 1;
|
||||
for(int i = 0; i < remaining; i++) if(rec.getCanFire(stack).apply(stack, ctx)) rec.getOnFire(stack).accept(stack, ctx);
|
||||
|
||||
@ -419,4 +419,11 @@ public class Orchestras {
|
||||
if(timer == 27) player.worldObj.playSoundAtEntity(player, "hbm:weapon.glClose", 1F, 1F);
|
||||
}
|
||||
};
|
||||
|
||||
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_FLAMER = (stack, ctx) -> {
|
||||
EntityPlayer player = ctx.player;
|
||||
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
|
||||
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
|
||||
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
|
||||
};
|
||||
}
|
||||
|
||||
@ -0,0 +1,55 @@
|
||||
package com.hbm.items.weapon.sedna.factory;
|
||||
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.BulletConfig;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.items.weapon.sedna.GunConfig;
|
||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
|
||||
import com.hbm.items.weapon.sedna.Receiver;
|
||||
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
|
||||
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.particle.helper.FlameCreator;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.BusAnimationSequence;
|
||||
import com.hbm.render.anim.BusAnimationKeyframe.IType;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class XFactoryFlamer {
|
||||
|
||||
public static BulletConfig flame_diesel;
|
||||
|
||||
public static void init() {
|
||||
flame_diesel = new BulletConfig().setItem(EnumAmmo.FLAME_DIESEL).setLife(100).setVel(1F).setGrav(0.02D).setReloadCount(200)
|
||||
.setOnUpdate((bullet) -> {
|
||||
if(!bullet.worldObj.isRemote) FlameCreator.composeEffect(bullet.worldObj, bullet.posX, bullet.posY - 0.25, bullet.posZ);
|
||||
});
|
||||
|
||||
ModItems.gun_flamer = new ItemGunBaseNT(new GunConfig()
|
||||
.dura(20_000).draw(4).inspect(23).crosshair(Crosshair.CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(10F).delay(1).auto(true).reload(55).jam(0)
|
||||
.mag(new MagazineFullReload(0, 200).addConfigs(flame_diesel))
|
||||
.offset(0.75, -0.0625, -0.3125D)
|
||||
.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE).fire(Lego.LAMBDA_STANDARD_FIRE).recoil(Lego.LAMBDA_STANDARD_RECOIL))
|
||||
.setupStandardConfiguration()
|
||||
.anim(LAMBDA_FLAMER_ANIMS).orchestra(Orchestras.ORCHESTRA_FLAMER)
|
||||
).setUnlocalizedName("gun_flamer").setTextureName(RefStrings.MODID + ":gun_darter");
|
||||
}
|
||||
|
||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_FLAMER_ANIMS = (stack, type) -> {
|
||||
switch(type) {
|
||||
case EQUIP: return new BusAnimation()
|
||||
.addBus("EQUIP", new BusAnimationSequence().addPos(-90, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_DOWN));
|
||||
case RELOAD: return new BusAnimation();
|
||||
case INSPECT: return new BusAnimation();
|
||||
case JAMMED: return new BusAnimation();
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
}
|
||||
@ -51,8 +51,9 @@ public class MagazineFullReload extends MagazineSingleTypeBase {
|
||||
for(BulletConfig config : this.acceptedBullets) {
|
||||
if(config.ammo.matchesRecipe(slot, true)) {
|
||||
this.setType(stack, config);
|
||||
int toLoad = Math.min(this.getCapacity(stack), slot.stackSize);
|
||||
this.setAmount(stack, toLoad);
|
||||
int wantsToLoad = (int) Math.ceil((double) this.getCapacity(stack) / (double) config.ammoReloadCount);
|
||||
int toLoad = Math.min(wantsToLoad, slot.stackSize);
|
||||
this.setAmount(stack, Math.min(toLoad * config.ammoReloadCount, this.capacity));
|
||||
player.inventory.decrStackSize(i, toLoad);
|
||||
break;
|
||||
}
|
||||
@ -64,8 +65,9 @@ public class MagazineFullReload extends MagazineSingleTypeBase {
|
||||
|
||||
if(config.ammo.matchesRecipe(slot, true)) {
|
||||
int alreadyLoaded = this.getAmount(stack);
|
||||
int toLoad = Math.min(this.getCapacity(stack) - alreadyLoaded, slot.stackSize);
|
||||
this.setAmount(stack, toLoad + alreadyLoaded);
|
||||
int wantsToLoad = (int) Math.ceil((double) this.getCapacity(stack) / (double) config.ammoReloadCount) - (alreadyLoaded / config.ammoReloadCount);
|
||||
int toLoad = Math.min(wantsToLoad, slot.stackSize);
|
||||
this.setAmount(stack, Math.min((toLoad * config.ammoReloadCount) + alreadyLoaded, this.capacity));
|
||||
player.inventory.decrStackSize(i, toLoad);
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,10 +95,6 @@ public class ModDamageSource extends DamageSource {
|
||||
return (new EntityDamageSourceIndirect(s_euthanized, ent, hit)).setDamageBypassesArmor();
|
||||
}
|
||||
|
||||
public static DamageSource causeFireDamage(EntityFire ent, Entity hit) {
|
||||
return (new EntityDamageSourceIndirect(s_flamethrower, ent, hit)).setFireDamage().setDamageBypassesArmor();
|
||||
}
|
||||
|
||||
public static DamageSource causePlasmaDamage(EntityPlasmaBeam ent, Entity hit) {
|
||||
return (new EntityDamageSourceIndirect(s_immolator, ent, hit)).setDamageBypassesArmor();
|
||||
}
|
||||
|
||||
@ -580,7 +580,6 @@ public class ClientProxy extends ServerProxy {
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_deagle, new ItemRenderWeaponObj());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_supershotgun, new ItemRenderWeaponShotty());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_ks23, new ItemRenderWeaponKS23());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_flamer, new ItemRenderWeaponObj());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_flechette, new ItemRenderWeaponObj());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_quadro, new ItemRenderWeaponQuadro());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_sauer, new ItemRenderWeaponSauer());
|
||||
@ -631,7 +630,6 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBulletBaseMK4.class, new RenderBulletMK4());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityRainbow.class, new RenderRainbow());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityNightmareBlast.class, new RenderOminousBullet());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityFire.class, new RenderFireball(ModItems.nothing));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityPlasmaBeam.class, new RenderBeam());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityLaserBeam.class, new RenderBeam2());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMinerBeam.class, new RenderBeam3());
|
||||
@ -640,7 +638,6 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityModBeam.class, new RenderBeam6());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntitySiegeLaser.class, new RenderSiegeLaser());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityLN2.class, new RenderLN2(ModItems.nothing));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityLaser.class, new RenderLaser());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBombletZeta.class, new RenderBombletTheta());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityMeteor.class, new RenderMeteor());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBoxcar.class, new RenderBoxcar());
|
||||
@ -988,6 +985,7 @@ public class ClientProxy extends ServerProxy {
|
||||
static {
|
||||
particleCreators.put("explosionLarge", new ExplosionCreator());
|
||||
particleCreators.put("casingNT", new CasingCreator());
|
||||
particleCreators.put("flamethrower", new FlameCreator());
|
||||
}
|
||||
|
||||
//mk3, only use this one
|
||||
|
||||
@ -867,6 +867,7 @@ public class MainRegistry {
|
||||
|
||||
FalloutConfigJSON.initialize();
|
||||
ItemPoolConfigJSON.initialize();
|
||||
ClientConfig.initConfig();
|
||||
|
||||
TileEntityNukeCustom.registerBombItems();
|
||||
ArmorUtil.register();
|
||||
@ -898,6 +899,7 @@ public class MainRegistry {
|
||||
|
||||
Compat.handleRailcraftNonsense();
|
||||
SuicideThreadDump.register();
|
||||
CommandReloadClient.register();
|
||||
|
||||
//ExplosionTests.runTest();
|
||||
}
|
||||
@ -1424,6 +1426,17 @@ public class MainRegistry {
|
||||
ignoreMappings.add("hbm:item.gas8");
|
||||
ignoreMappings.add("hbm:tile.brick_forgotten");
|
||||
ignoreMappings.add("hbm:tile.watz_conductor");
|
||||
ignoreMappings.add("hbm:item.flame_1");
|
||||
ignoreMappings.add("hbm:item.flame_2");
|
||||
ignoreMappings.add("hbm:item.flame_3");
|
||||
ignoreMappings.add("hbm:item.flame_3");
|
||||
ignoreMappings.add("hbm:item.flame_4");
|
||||
ignoreMappings.add("hbm:item.flame_5");
|
||||
ignoreMappings.add("hbm:item.flame_6");
|
||||
ignoreMappings.add("hbm:item.flame_7");
|
||||
ignoreMappings.add("hbm:item.flame_8");
|
||||
ignoreMappings.add("hbm:item.flame_9");
|
||||
ignoreMappings.add("hbm:item.flame_10");
|
||||
|
||||
/// REMAP ///
|
||||
remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses);
|
||||
|
||||
@ -1073,7 +1073,7 @@ public class ModEventHandler {
|
||||
/// NEW ITEM SYS END ///
|
||||
|
||||
/// SYNC START ///
|
||||
if(player instanceof EntityPlayerMP) PacketDispatcher.wrapper.sendTo(new PermaSyncPacket((EntityPlayerMP) player), (EntityPlayerMP) player);
|
||||
if(!player.worldObj.isRemote && player instanceof EntityPlayerMP) PacketDispatcher.wrapper.sendTo(new PermaSyncPacket((EntityPlayerMP) player), (EntityPlayerMP) player);
|
||||
/// SYNC END ///
|
||||
}
|
||||
|
||||
|
||||
@ -815,7 +815,6 @@ public class ResourceManager {
|
||||
public static final IModelCustom deagle = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/deagle.obj"));
|
||||
public static final IModelCustom shotty = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/supershotty.obj"));
|
||||
public static final IModelCustom ks23 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/ks23.obj"));
|
||||
public static final IModelCustom flamer = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/flamer.obj"));
|
||||
public static final IModelCustom flechette = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/flechette.obj"));
|
||||
public static final IModelCustom quadro = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/quadro.obj"));
|
||||
public static final IModelCustom sauergun = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/sauergun.obj"));
|
||||
@ -859,6 +858,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom carbine = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/carbine.obj")).asVBO();
|
||||
public static final IModelCustom am180 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/am180.obj")).asVBO();
|
||||
public static final IModelCustom liberator = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/liberator.obj")).asVBO();
|
||||
public static final IModelCustom flamethrower = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/flamethrower.obj")).asVBO();
|
||||
|
||||
public static final HashMap<String, BusAnimation> python_anim = AnimationLoader.load(new ResourceLocation(RefStrings.MODID, "models/weapons/animations/python.json"));
|
||||
public static final HashMap<String, BusAnimation> cursed_anim = AnimationLoader.load(new ResourceLocation(RefStrings.MODID, "models/weapons/animations/cursed.json"));
|
||||
@ -917,7 +917,6 @@ public class ResourceManager {
|
||||
public static final ResourceLocation deagle_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/deagle.png");
|
||||
public static final ResourceLocation ks23_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/ks23.png");
|
||||
public static final ResourceLocation shotty_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/shotty.png");
|
||||
public static final ResourceLocation flamer_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/flamer.png");
|
||||
public static final ResourceLocation flechette_body = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/flechette_body.png");
|
||||
public static final ResourceLocation flechette_barrel = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/flechette_barrel.png");
|
||||
public static final ResourceLocation flechette_gren_tube = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/flechette_gren_tube.png");
|
||||
@ -981,6 +980,7 @@ public class ResourceManager {
|
||||
public static final ResourceLocation carbine_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/huntsman.png");
|
||||
public static final ResourceLocation am180_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/am180.png");
|
||||
public static final ResourceLocation liberator_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/liberator.png");
|
||||
public static final ResourceLocation flamethrower_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/flamethrower.png");
|
||||
|
||||
public static final ResourceLocation lance_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lance.png");
|
||||
|
||||
|
||||
66
src/main/java/com/hbm/particle/EntityFXRotating.java
Normal file
66
src/main/java/com/hbm/particle/EntityFXRotating.java
Normal file
@ -0,0 +1,66 @@
|
||||
package com.hbm.particle;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class EntityFXRotating extends EntityFX {
|
||||
|
||||
protected EntityFXRotating(World world, double x, double y, double z) {
|
||||
super(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public void renderParticleRotated(Tessellator tess, float interp, float sX, float sY, float sZ, float dX, float dZ, double scale) {
|
||||
|
||||
float pX = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) interp - interpPosX);
|
||||
float pY = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) interp - interpPosY);
|
||||
float pZ = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) interp - interpPosZ);
|
||||
float rotation = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * interp;
|
||||
|
||||
double x1 = 0 - sX * scale - dX * scale;
|
||||
double y1 = 0 - sY * scale;
|
||||
double z1 = 0 - sZ * scale - dZ * scale;
|
||||
double x2 = 0 - sX * scale + dX * scale;
|
||||
double y2 = 0 + sY * scale;
|
||||
double z2 = 0 - sZ * scale + dZ * scale;
|
||||
double x3 = 0 + sX * scale + dX * scale;
|
||||
double y3 = 0 + sY * scale;
|
||||
double z3 = 0 + sZ * scale + dZ * scale;
|
||||
double x4 = 0 + sX * scale - dX * scale;
|
||||
double y4 = 0 - sY * scale;
|
||||
double z4 = 0 + sZ * scale - dZ * scale;
|
||||
|
||||
double nX = ((y2 - y1) * (z3 - z1)) - ((z2 - z1) * (y3 - y1));
|
||||
double nY = ((z2 - z1) * (x3 - x1)) - ((x2 - x1) * (z3 - z1));
|
||||
double nZ = ((x2 - x1) * (y3 - y1)) - ((y2 - y1) * (x3 - x1));
|
||||
|
||||
double cosTh = Math.cos(rotation * Math.PI / 180D);
|
||||
double sinTh = Math.sin(rotation * Math.PI / 180D);
|
||||
|
||||
double x01 = x1 * cosTh + (nY * z1 - nZ * y1) * sinTh;
|
||||
double y01 = y1 * cosTh + (nZ * x1 - nX * z1) * sinTh;
|
||||
double z01 = z1 * cosTh + (nX * y1 - nY * x1) * sinTh;
|
||||
double x02 = x2 * cosTh + (nY * z2 - nZ * y2) * sinTh;
|
||||
double y02 = y2 * cosTh + (nZ * x2 - nX * z2) * sinTh;
|
||||
double z02 = z2 * cosTh + (nX * y2 - nY * x2) * sinTh;
|
||||
double x03 = x3 * cosTh + (nY * z3 - nZ * y3) * sinTh;
|
||||
double y03 = y3 * cosTh + (nZ * x3 - nX * z3) * sinTh;
|
||||
double z03 = z3 * cosTh + (nX * y3 - nY * x3) * sinTh;
|
||||
double x04 = x4 * cosTh + (nY * z4 - nZ * y4) * sinTh;
|
||||
double y04 = y4 * cosTh + (nZ * x4 - nX * z4) * sinTh;
|
||||
double z04 = z4 * cosTh + (nX * y4 - nY * x4) * sinTh;
|
||||
|
||||
tess.addVertexWithUV(pX + x01, pY + y01, pZ + z01, particleIcon.getMaxU(), particleIcon.getMaxV());
|
||||
tess.addVertexWithUV(pX + x02, pY + y02, pZ + z02, particleIcon.getMaxU(), particleIcon.getMinV());
|
||||
tess.addVertexWithUV(pX + x03, pY + y03, pZ + z03, particleIcon.getMinU(), particleIcon.getMinV());
|
||||
tess.addVertexWithUV(pX + x04, pY + y04, pZ + z04, particleIcon.getMinU(), particleIcon.getMaxV());
|
||||
}
|
||||
}
|
||||
74
src/main/java/com/hbm/particle/ParticleFlamethrower.java
Normal file
74
src/main/java/com/hbm/particle/ParticleFlamethrower.java
Normal file
@ -0,0 +1,74 @@
|
||||
package com.hbm.particle;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import com.hbm.main.ModEventHandlerClient;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ParticleFlamethrower extends EntityFXRotating {
|
||||
|
||||
public ParticleFlamethrower(World world, double x, double y, double z) {
|
||||
super(world, x, y, z);
|
||||
particleIcon = ModEventHandlerClient.particleBase;
|
||||
this.particleMaxAge = 20 + rand.nextInt(10);
|
||||
this.particleScale = 0.5F;
|
||||
|
||||
this.motionX = world.rand.nextGaussian() * 0.02;
|
||||
this.motionZ = world.rand.nextGaussian() * 0.02;
|
||||
|
||||
Color color = Color.getHSBColor((15F + rand.nextFloat() * 25F) / 255F, 1F, 1F);
|
||||
this.particleRed = color.getRed() / 255F;
|
||||
this.particleGreen = color.getGreen() / 255F;
|
||||
this.particleBlue = color.getBlue() / 255F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
this.particleAge++;
|
||||
|
||||
if(this.particleAge >= this.particleMaxAge) {
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
this.motionX *= 0.91D;
|
||||
this.motionY *= 0.91D;
|
||||
this.motionZ *= 0.91D;
|
||||
|
||||
this.motionY += 0.01D;
|
||||
this.prevRotationPitch = this.rotationPitch;
|
||||
this.rotationPitch += 30 * ((this.getEntityId() % 2) - 0.5);
|
||||
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator tess, float interp, float sX, float sY, float sZ, float dX, float dZ) {
|
||||
|
||||
double ageScaled = (double) this.particleAge / (double) this.particleMaxAge;
|
||||
|
||||
this.particleAlpha = (float) Math.pow(1 - Math.min(ageScaled, 1), 0.5);
|
||||
float add = 0.75F - (float) ageScaled;
|
||||
|
||||
tess.setColorRGBA_F(this.particleRed + add, this.particleGreen + add, this.particleBlue + add, this.particleAlpha * 0.5F);
|
||||
tess.setNormal(0.0F, 1.0F, 0.0F);
|
||||
tess.setBrightness(240);
|
||||
|
||||
double scale = (ageScaled * 0.75 + 0.5) * particleScale;
|
||||
renderParticleRotated(tess, interp, sX, sY, sZ, dX, dZ, scale);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getBrightnessForRender(float p_70070_1_) {
|
||||
return 15728880;
|
||||
}
|
||||
}
|
||||
@ -1,12 +0,0 @@
|
||||
package com.hbm.particle;
|
||||
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
//TODO: everything
|
||||
public class ParticleLargeFlame extends EntityFX {
|
||||
|
||||
protected ParticleLargeFlame(World world, double x, double y, double z) {
|
||||
super(world, x, y, z);
|
||||
}
|
||||
}
|
||||
@ -74,5 +74,4 @@ public class CasingCreator implements IParticleCreator {
|
||||
casing.prevRotationPitch = casing.rotationPitch = pitch;
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(casing);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
26
src/main/java/com/hbm/particle/helper/FlameCreator.java
Normal file
26
src/main/java/com/hbm/particle/helper/FlameCreator.java
Normal file
@ -0,0 +1,26 @@
|
||||
package com.hbm.particle.helper;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.particle.ParticleFlamethrower;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class FlameCreator implements IParticleCreator {
|
||||
|
||||
public static void composeEffect(World world, double x, double y, double z) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "flamethrower");
|
||||
IParticleCreator.sendPacket(world, x, y, z, 50, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void makeParticle(World world, EntityPlayer player, TextureManager texman, Random rand, double x, double y, double z, NBTTagCompound data) {
|
||||
ParticleFlamethrower particle = new ParticleFlamethrower(world, x, y, z);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(particle);
|
||||
}
|
||||
}
|
||||
@ -21,7 +21,7 @@ public class EventHandlerParticleEngine {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRenderWorldLast(RenderWorldLastEvent event) {
|
||||
float interp = event.partialTicks;
|
||||
//float interp = event.partialTicks;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
@ -1,140 +0,0 @@
|
||||
package com.hbm.render.entity.effect;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import com.hbm.entity.projectile.EntityFire;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RenderFireball extends Render {
|
||||
private Item field_94151_a;
|
||||
public RenderFireball(Item p_i1259_1_, int p_i1259_2_)
|
||||
{
|
||||
this.field_94151_a = p_i1259_1_;
|
||||
}
|
||||
|
||||
public RenderFireball(Item p_i1260_1_)
|
||||
{
|
||||
this(p_i1260_1_, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
|
||||
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
|
||||
* (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
|
||||
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
|
||||
*/
|
||||
@Override
|
||||
public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
|
||||
{
|
||||
if(p_76986_1_ instanceof EntityFire)
|
||||
{
|
||||
EntityFire fx = (EntityFire)p_76986_1_;
|
||||
|
||||
if(fx.ticksExisted <= fx.maxAge && fx.ticksExisted >= fx.maxAge / 10 * 9)
|
||||
{
|
||||
field_94151_a = ModItems.flame_10;
|
||||
}
|
||||
|
||||
if(fx.ticksExisted < fx.maxAge / 10 * 9 && fx.ticksExisted >= fx.maxAge / 10 * 8)
|
||||
{
|
||||
field_94151_a = ModItems.flame_9;
|
||||
}
|
||||
|
||||
if(fx.ticksExisted < fx.maxAge / 10 * 8 && fx.ticksExisted >= fx.maxAge / 10 * 7)
|
||||
{
|
||||
field_94151_a = ModItems.flame_8;
|
||||
}
|
||||
|
||||
if(fx.ticksExisted < fx.maxAge / 10 * 7 && fx.ticksExisted >= fx.maxAge / 10 * 6)
|
||||
{
|
||||
field_94151_a = ModItems.flame_7;
|
||||
}
|
||||
|
||||
if(fx.ticksExisted < fx.maxAge / 10 * 6 && fx.ticksExisted >= fx.maxAge / 10 * 5)
|
||||
{
|
||||
field_94151_a = ModItems.flame_6;
|
||||
}
|
||||
|
||||
if(fx.ticksExisted < fx.maxAge / 10 * 5 && fx.ticksExisted >= fx.maxAge / 10 * 4)
|
||||
{
|
||||
field_94151_a = ModItems.flame_5;
|
||||
}
|
||||
|
||||
if(fx.ticksExisted < fx.maxAge / 10 * 4 && fx.ticksExisted >= fx.maxAge / 10 * 3)
|
||||
{
|
||||
field_94151_a = ModItems.flame_4;
|
||||
}
|
||||
|
||||
if(fx.ticksExisted < fx.maxAge / 10 * 3 && fx.ticksExisted >= fx.maxAge / 10 * 2)
|
||||
{
|
||||
field_94151_a = ModItems.flame_3;
|
||||
}
|
||||
|
||||
if(fx.ticksExisted < fx.maxAge / 10 * 2 && fx.ticksExisted >= fx.maxAge / 10 * 1)
|
||||
{
|
||||
field_94151_a = ModItems.flame_2;
|
||||
}
|
||||
|
||||
if(fx.ticksExisted < fx.maxAge / 10 && fx.ticksExisted >= 0 && !fx.isDead)
|
||||
{
|
||||
field_94151_a = ModItems.flame_1;
|
||||
}
|
||||
|
||||
IIcon iicon = field_94151_a.getIconFromDamage(0);
|
||||
|
||||
if (iicon != null)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_, (float)p_76986_6_);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
GL11.glScalef(7.5F, 7.5F, 7.5F);
|
||||
GL11.glTranslatef(0.0F, -0.25F, 0.0F);
|
||||
this.bindEntityTexture(p_76986_1_);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
this.func_77026_a(tessellator, iicon);
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
|
||||
*/
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity p_110775_1_)
|
||||
{
|
||||
return TextureMap.locationItemsTexture;
|
||||
}
|
||||
|
||||
private void func_77026_a(Tessellator p_77026_1_, IIcon p_77026_2_)
|
||||
{
|
||||
float f = p_77026_2_.getMinU();
|
||||
float f1 = p_77026_2_.getMaxU();
|
||||
float f2 = p_77026_2_.getMinV();
|
||||
float f3 = p_77026_2_.getMaxV();
|
||||
float f4 = 1.0F;
|
||||
float f5 = 0.5F;
|
||||
float f6 = 0.25F;
|
||||
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
|
||||
p_77026_1_.startDrawingQuads();
|
||||
p_77026_1_.setNormal(0.0F, 1.0F, 0.0F);
|
||||
p_77026_1_.addVertexWithUV(0.0F - f5, 0.0F - f6, 0.0D, f, f3);
|
||||
p_77026_1_.addVertexWithUV(f4 - f5, 0.0F - f6, 0.0D, f1, f3);
|
||||
p_77026_1_.addVertexWithUV(f4 - f5, f4 - f6, 0.0D, f1, f2);
|
||||
p_77026_1_.addVertexWithUV(0.0F - f5, f4 - f6, 0.0D, f, f2);
|
||||
p_77026_1_.draw();
|
||||
}
|
||||
}
|
||||
@ -1,57 +0,0 @@
|
||||
package com.hbm.render.entity.projectile;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.entity.projectile.EntityLaser;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.render.util.BeamPronter;
|
||||
import com.hbm.render.util.BeamPronter.EnumBeamType;
|
||||
import com.hbm.render.util.BeamPronter.EnumWaveType;
|
||||
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
public class RenderLaser extends Render {
|
||||
|
||||
@Override
|
||||
public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) {
|
||||
this.doRender((EntityLaser)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
|
||||
}
|
||||
|
||||
public void doRender(EntityLaser laser, double x, double y, double z, float p_76986_8_, float p_76986_9_) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
EntityPlayer player = laser.worldObj.getPlayerEntityByName(laser.getDataWatcher().getWatchableObjectString(20));
|
||||
|
||||
if(player != null) {
|
||||
|
||||
|
||||
|
||||
//GL11.glTranslated(x - dX, y - dY, z - dZ);
|
||||
|
||||
GL11.glTranslated(x, y, z);
|
||||
|
||||
MovingObjectPosition pos = Library.rayTrace(player, 100, 1);
|
||||
|
||||
Vec3 skeleton = Vec3.createVectorHelper(pos.hitVec.xCoord - player.posX, pos.hitVec.yCoord - player.posY - player.getEyeHeight(), pos.hitVec.zCoord - player.posZ);
|
||||
int init = (int) -(System.currentTimeMillis() % 360);
|
||||
|
||||
//BeamPronter.prontHelix(skeleton, 0, 0, 0, EnumWaveType.SPIRAL, EnumBeamType.LINE, 0x0000ff, 0x8080ff, 0, (int)(skeleton.lengthVector() * 5), 0.2F);
|
||||
BeamPronter.prontBeam(skeleton, EnumWaveType.SPIRAL, EnumBeamType.SOLID, 0xff5000, 0xff5000, init, (int) skeleton.lengthVector() + 1, 0.1F, 4, 0.05F);
|
||||
BeamPronter.prontBeam(skeleton, EnumWaveType.SPIRAL, EnumBeamType.SOLID, 0xff3000, 0xff3000, init, 1, 0F, 4, 0.05F);
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -24,7 +24,7 @@ public class ItemRenderWeaponObj implements IItemRenderer {
|
||||
return true;
|
||||
case INVENTORY:
|
||||
return item.getItem() == ModItems.gun_hk69
|
||||
|| item.getItem() == ModItems.gun_flamer || item.getItem() == ModItems.gun_deagle
|
||||
|| item.getItem() == ModItems.gun_deagle
|
||||
|| item.getItem() == ModItems.gun_flechette || item.getItem() == ModItems.gun_quadro;
|
||||
default: return false;
|
||||
}
|
||||
@ -50,9 +50,6 @@ public class ItemRenderWeaponObj implements IItemRenderer {
|
||||
if(item.getItem() == ModItems.gun_deagle)
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.universal_bright);
|
||||
|
||||
if(item.getItem() == ModItems.gun_flamer)
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.flamer_tex);
|
||||
|
||||
if(item.getItem() == ModItems.gun_quadro)
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.quadro_tex);
|
||||
|
||||
@ -87,18 +84,6 @@ public class ItemRenderWeaponObj implements IItemRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
if(item.getItem() == ModItems.gun_flamer) {
|
||||
GL11.glTranslatef(1.0F, 0.0F, -0.15F);
|
||||
GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-25F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(-10F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glScaled(0.5, 0.5, 0.5);
|
||||
|
||||
if(player.isSneaking()) {
|
||||
GL11.glTranslatef(0.75F, 0.2F, 0.3F);
|
||||
}
|
||||
}
|
||||
|
||||
if(item.getItem() == ModItems.gun_flechette) {
|
||||
|
||||
GL11.glRotatef(25F, 0.0F, 0.0F, 1.0F);
|
||||
@ -153,13 +138,6 @@ public class ItemRenderWeaponObj implements IItemRenderer {
|
||||
GL11.glScaled(0.15, 0.15, 0.15);
|
||||
}
|
||||
|
||||
if(item.getItem() == ModItems.gun_flamer) {
|
||||
GL11.glRotatef(20F, 1.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(10F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glTranslatef(0.4F, -0.25F, 0.2F);
|
||||
GL11.glScaled(0.35, 0.35, 0.35);
|
||||
}
|
||||
|
||||
if(item.getItem() == ModItems.gun_flechette) {
|
||||
GL11.glRotatef(35F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F);
|
||||
@ -190,12 +168,6 @@ public class ItemRenderWeaponObj implements IItemRenderer {
|
||||
GL11.glScaled(0.25, 0.25, 0.25);
|
||||
}
|
||||
|
||||
if(item.getItem() == ModItems.gun_flamer) {
|
||||
GL11.glTranslatef(0.25F, 0.2F, 0.0F);
|
||||
GL11.glRotatef(-90F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glScaled(0.25, 0.25, 0.25);
|
||||
}
|
||||
|
||||
if(item.getItem() == ModItems.gun_flechette) {
|
||||
GL11.glTranslatef(-0.25F, 0.0F, 0.0F);
|
||||
GL11.glScaled(0.125, 0.125, 0.125);
|
||||
@ -229,14 +201,6 @@ public class ItemRenderWeaponObj implements IItemRenderer {
|
||||
GL11.glRotatef(-45F, 1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
if(item.getItem() == ModItems.gun_flamer) {
|
||||
GL11.glScaled(2.0, 2.0, -2.0);
|
||||
GL11.glTranslatef(4.0F, 5.0F, 0.0F);
|
||||
GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(-90F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-45F, 1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
if(item.getItem() == ModItems.gun_flechette) {
|
||||
GL11.glScaled(1.2, 1.2, -1.2);
|
||||
GL11.glTranslatef(2.5F, 8.0F, 0.0F);
|
||||
@ -268,13 +232,7 @@ public class ItemRenderWeaponObj implements IItemRenderer {
|
||||
ResourceManager.deagle.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
|
||||
if(item.getItem() == ModItems.gun_flamer) {
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.flamer.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
|
||||
|
||||
if(item.getItem() == ModItems.gun_flechette) {
|
||||
renderFlechette();
|
||||
}
|
||||
|
||||
@ -0,0 +1,84 @@
|
||||
package com.hbm.render.item.weapon.sedna;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
|
||||
import com.hbm.items.weapon.sedna.mags.IMagazine;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.anim.HbmAnimations;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemRenderFlamer extends ItemRenderWeaponBase {
|
||||
|
||||
@Override
|
||||
protected float getTurnMagnitude(ItemStack stack) { return ItemGunBaseNT.getIsAiming(stack) ? 2.5F : -0.5F; }
|
||||
|
||||
@Override
|
||||
public void setupFirstPerson(ItemStack stack) {
|
||||
GL11.glTranslated(0, 0, 0.875);
|
||||
|
||||
float offset = 0.8F;
|
||||
standardAimingTransform(stack,
|
||||
-1.5F * offset, -1.5F * offset, 2.75F * offset,
|
||||
0, -4.625 / 8D, 0.25);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderFirstPerson(ItemStack stack) {
|
||||
|
||||
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.flamethrower_tex);
|
||||
double scale = 0.375D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
|
||||
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP");
|
||||
|
||||
GL11.glTranslated(0, -1, -3);
|
||||
GL11.glRotated(equip[0], 1, 0, 0);
|
||||
GL11.glTranslated(0, 1, 3);
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
ResourceManager.flamethrower.renderPart("Gun");
|
||||
ResourceManager.flamethrower.renderPart("Tank");
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(1.25, 1.25, 0);
|
||||
IMagazine mag = gun.getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack);
|
||||
GL11.glRotated(-135 + (mag.getAmount(stack) * 270D / mag.getCapacity(stack)), 0, 0, 1);
|
||||
GL11.glTranslated(-1.25, -1.25, 0);
|
||||
ResourceManager.flamethrower.renderPart("Gauge");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupThirdPerson(ItemStack stack) {
|
||||
super.setupThirdPerson(stack);
|
||||
GL11.glTranslated(0, 1, 3);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupInv(ItemStack stack) {
|
||||
super.setupInv(stack);
|
||||
double scale = 1.25D;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
GL11.glRotated(25, 1, 0, 0);
|
||||
GL11.glRotated(45, 0, 1, 0);
|
||||
GL11.glTranslated(-1, 1, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderOther(ItemStack stack, ItemRenderType type) {
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.flamethrower_tex);
|
||||
ResourceManager.flamethrower.renderPart("Gun");
|
||||
ResourceManager.flamethrower.renderPart("Tank");
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
}
|
||||
@ -3,6 +3,7 @@ package com.hbm.render.util;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import com.hbm.config.ClientConfig;
|
||||
import com.hbm.extprop.HbmPlayerProps;
|
||||
import com.hbm.interfaces.Spaghetti;
|
||||
import com.hbm.interfaces.Untested;
|
||||
@ -58,8 +59,8 @@ public class RenderScreenOverlay {
|
||||
|
||||
int bar = getScaled(in, maxRad, 74);
|
||||
|
||||
int posX = 16;
|
||||
int posY = resolution.getScaledHeight() - 18 - 2;
|
||||
int posX = 16 + ClientConfig.GEIGER_OFFSET_HORIZONTAL.get();
|
||||
int posY = resolution.getScaledHeight() - 20 - ClientConfig.GEIGER_OFFSET_VERTICAL.get();
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(misc);
|
||||
gui.drawTexturedModalRect(posX, posY, 0, 0, 94, 18);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 361 B |
Binary file not shown.
|
Before Width: | Height: | Size: 4.6 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 6.1 KiB |
Loading…
x
Reference in New Issue
Block a user