BIG STEPPY

This commit is contained in:
Bob 2020-10-22 00:04:48 +02:00
parent c0dd864e03
commit c3ea6a2e84
21 changed files with 172 additions and 65 deletions

View File

@ -161,6 +161,9 @@
"entity.slicer": {"category": "neutral", "sounds": ["entity/slicer1", "entity/slicer2", "entity/slicer3", "entity/slicer4"]},
"step.metal": {"category": "player", "sounds": [{"name": "footsteps/metal", "stream": false}]},
"step.iron_jump": {"category": "player", "sounds": [{"name": "footsteps/iron_jump", "stream": false}]},
"step.iron_land": {"category": "player", "sounds": [{"name": "footsteps/iron_land", "stream": false}]},
"step.iron": {"category": "player", "sounds": ["footsteps/iron1", "footsteps/iron2", "footsteps/iron3", "footsteps/iron4"]},
"potatos.random": {"category": "player", "sounds": ["potatos/randResponse0", "potatos/randResponse1", "potatos/randResponse2", "potatos/randResponse3", "potatos/randResponse4", "potatos/randResponse5", "potatos/randResponse6", "potatos/randResponse7"]},

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -600,6 +600,7 @@ public class ModBlocks {
public static Block machine_amgen;
public static Block machine_geo;
public static Block machine_minirtg;
public static Block machine_powerrtg;
public static Block machine_well;
public static Block oil_pipe;
@ -1169,6 +1170,7 @@ public class ModBlocks {
machine_amgen = new MachineAmgen(Material.iron).setBlockName("machine_amgen").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
machine_geo = new MachineAmgen(Material.iron).setBlockName("machine_geo").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
machine_minirtg = new MachineMiniRTG(Material.iron).setBlockName("machine_minirtg").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rtg_cell");
machine_powerrtg = new MachineMiniRTG(Material.iron).setBlockName("machine_powerrtg").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rtg_polonium");
red_wire_coated = new WireCoated(Material.iron).setBlockName("red_wire_coated").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_wire_coated");
red_cable = new BlockCable(Material.iron).setBlockName("red_cable").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_cable_icon");
@ -1858,6 +1860,7 @@ public class ModBlocks {
GameRegistry.registerBlock(machine_geo, machine_geo.getUnlocalizedName());
GameRegistry.registerBlock(machine_amgen, machine_amgen.getUnlocalizedName());
GameRegistry.registerBlock(machine_minirtg, machine_minirtg.getUnlocalizedName());
GameRegistry.registerBlock(machine_powerrtg, machine_powerrtg.getUnlocalizedName());
GameRegistry.registerBlock(machine_spp_bottom, machine_spp_bottom.getUnlocalizedName());
GameRegistry.registerBlock(machine_spp_top, machine_spp_top.getUnlocalizedName());

View File

@ -0,0 +1,71 @@
package com.hbm.handler;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
public class HTTPHandler {
public static String capsule = "ERROR ";
public static boolean newVersion = false;
public static String versionNumber = "";
public static void loadStats() {
try {
loadVersion();
loadSoyuz();
} catch (IOException e) {
MainRegistry.logger.warn("Version checker failed!");
}
}
private static void loadVersion() throws IOException {
URL github = new URL("https://raw.githubusercontent.com/HbmMods/Hbm-s-Nuclear-Tech-GIT/master/src/main/java/com/hbm/lib/RefStrings.java");
BufferedReader in = new BufferedReader(new InputStreamReader(github.openStream()));
MainRegistry.logger.info("Searching for new versions...");
String line;
while ((line = in.readLine()) != null) {
if(line.contains("String VERSION")) {
int begin = line.indexOf('"');
int end = line.lastIndexOf('"');
String sub = line.substring(begin + 1, end);
newVersion = !RefStrings.VERSION.equals(sub);
versionNumber = sub;
MainRegistry.logger.info("Found version " + sub);
break;
}
}
MainRegistry.logger.info("Version checker ended.");
in.close();
}
private static void loadSoyuz() throws IOException {
URL github = new URL("https://gist.githubusercontent.com/HbmMods/a1cad71d00b6915945a43961d0037a43/raw/soyuz_holo");
BufferedReader in = new BufferedReader(new InputStreamReader(github.openStream()));
String line = in.readLine();
if(line != null)
capsule = line;
in.close();
}
}

View File

@ -1,50 +0,0 @@
package com.hbm.handler;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
public class VersionChecker {
public static boolean newVersion = false;
public static String versionNumber = "";
public static void checkVersion() {
try {
URL github = new URL("https://raw.githubusercontent.com/HbmMods/Hbm-s-Nuclear-Tech-GIT/master/src/main/java/com/hbm/lib/RefStrings.java");
BufferedReader in = new BufferedReader(new InputStreamReader(github.openStream()));
MainRegistry.logger.info("Searching for new versions...");
String line;
while ((line = in.readLine()) != null) {
if(line.contains("String VERSION")) {
int begin = line.indexOf('"');
int end = line.lastIndexOf('"');
String sub = line.substring(begin + 1, end);
newVersion = !RefStrings.VERSION.equals(sub);
versionNumber = sub;
MainRegistry.logger.info("Found version " + sub);
break;
}
}
MainRegistry.logger.info("Version checker ended.");
in.close();
} catch (IOException e) {
MainRegistry.logger.warn("Version checker failed!");
}
}
}

View File

@ -3618,6 +3618,8 @@ public class ModItems {
.addEffect(new PotionEffect(Potion.jump.id, 20, 0))
.setGravity(0.02D)
.setStep("hbm:step.metal")
.setJump("hbm:step.iron_jump")
.setFall("hbm:step.iron_land")
.addResistance("fall", 0).setUnlocalizedName("bj_helmet").setTextureName(RefStrings.MODID + ":bj_helmet");
bj_plate = new ArmorBJ(MainRegistry.aMatStarmetal, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000, 100, 10).cloneStats((ArmorFSB) bj_helmet).setUnlocalizedName("bj_plate").setTextureName(RefStrings.MODID + ":bj_plate");
bj_legs = new ArmorBJ(MainRegistry.aMatStarmetal, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 10000, 100, 10).cloneStats((ArmorFSB) bj_helmet).setUnlocalizedName("bj_legs").setTextureName(RefStrings.MODID + ":bj_legs");

View File

@ -1,5 +1,6 @@
package com.hbm.items.armor;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -10,8 +11,11 @@ import org.lwjgl.opengl.GL11;
import com.hbm.interfaces.Untested;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.relauncher.ReflectionHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.OpenGlHelper;
@ -25,6 +29,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.sound.PlaySoundEvent17;
import net.minecraftforge.event.entity.living.LivingAttackEvent;
@ -47,6 +52,8 @@ public class ArmorFSB extends ItemArmor {
public boolean thermal = false;
public double gravity = 0;
public String step;
public String jump;
public String fall;
public ArmorFSB(ArmorMaterial material, int layer, int slot, String texture) {
super(material, layer, slot);
@ -98,6 +105,16 @@ public class ArmorFSB extends ItemArmor {
return this;
}
public ArmorFSB setJump(String jump) {
this.jump = jump;
return this;
}
public ArmorFSB setFall(String fall) {
this.fall = fall;
return this;
}
public ArmorFSB setOverlay(String path) {
this.overlay = new ResourceLocation(path);
return this;
@ -115,6 +132,8 @@ public class ArmorFSB extends ItemArmor {
this.thermal = original.thermal;
this.gravity = original.gravity;
this.step = original.step;
this.jump = original.jump;
this.fall = original.fall;
//overlay doesn't need to be copied because it's helmet exclusive
return this;
}
@ -269,9 +288,44 @@ public class ArmorFSB extends ItemArmor {
if(!player.capabilities.isFlying && !player.isInWater())
player.motionY -= chestplate.gravity;
if(chestplate.step != null && player.worldObj.isRemote && player.onGround) {
try {
Field nextStepDistance = ReflectionHelper.findField(Entity.class, "nextStepDistance", "field_70150_b");
Field distanceWalkedOnStepModified = ReflectionHelper.findField(Entity.class, "distanceWalkedOnStepModified", "field_82151_R");
if(player.getEntityData().getFloat("hfr_nextStepDistance") == 0) {
player.getEntityData().setFloat("hfr_nextStepDistance", nextStepDistance.getFloat(player));
}
int px = MathHelper.floor_double(player.posX);
int py = MathHelper.floor_double(player.posY - 0.2D - (double)player.yOffset);
int pz = MathHelper.floor_double(player.posZ);
Block block = player.worldObj.getBlock(px, py, pz);
if(block.getMaterial() != Material.air && player.getEntityData().getFloat("hfr_nextStepDistance") <= distanceWalkedOnStepModified.getFloat(player))
player.playSound(chestplate.step, 1.0F, 1.0F);
player.getEntityData().setFloat("hfr_nextStepDistance", nextStepDistance.getFloat(player));
} catch (Exception x) { }
}
}
}
@Untested
public static void handleJump(EntityPlayer player) {
if(ArmorFSB.hasFSBArmor(player)) {
ArmorFSB chestplate = (ArmorFSB) player.inventory.armorInventory[3].getItem();
if(chestplate.jump != null)
player.playSound(chestplate.jump, 1.0F, 1.0F);
}
}
@Untested
public static void handleFall(EntityPlayer player) {
@ -279,8 +333,8 @@ public class ArmorFSB extends ItemArmor {
ArmorFSB chestplate = (ArmorFSB) player.inventory.armorInventory[3].getItem();
if(chestplate.step != null)
player.playSound(chestplate.step, 1.0F, 1.0F);
if(chestplate.fall != null)
player.playSound(chestplate.fall, 1.0F, 1.0F);
}
}

View File

@ -214,7 +214,7 @@ public class MainRegistry {
BulletConfigSyncingUtil.loadConfigsForSync();
CellularDungeonFactory.init();
Satellite.register();
VersionChecker.checkVersion();
HTTPHandler.loadStats();
loadConfig(PreEvent);
CraftingManager.mainRegistry();
AssemblerRecipes.preInit(PreEvent.getModConfigurationDirectory());

View File

@ -21,7 +21,7 @@ import com.hbm.entity.projectile.EntityMeteor;
import com.hbm.handler.ArmorUtil;
import com.hbm.handler.BossSpawnHandler;
import com.hbm.handler.RadiationWorldHandler;
import com.hbm.handler.VersionChecker;
import com.hbm.handler.HTTPHandler;
import com.hbm.items.ModItems;
import com.hbm.items.armor.ArmorFSB;
import com.hbm.lib.Library;
@ -67,6 +67,7 @@ import net.minecraftforge.event.ServerChatEvent;
import net.minecraftforge.event.entity.EntityEvent.EnteringChunk;
import net.minecraftforge.event.entity.living.LivingAttackEvent;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent;
import net.minecraftforge.event.entity.living.LivingFallEvent;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import net.minecraftforge.event.entity.living.LivingSpawnEvent;
@ -85,8 +86,8 @@ public class ModEventHandler
if(!event.player.worldObj.isRemote) {
event.player.addChatMessage(new ChatComponentText("Loaded world with Hbm's Nuclear Tech Mod " + RefStrings.VERSION + " for Minecraft 1.7.10!"));
if(VersionChecker.newVersion) {
event.player.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "New version " + VersionChecker.versionNumber + " is available!"));
if(HTTPHandler.newVersion) {
event.player.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "New version " + HTTPHandler.versionNumber + " is available!"));
}
if(event.player instanceof EntityPlayerMP && !event.player.getEntityData().getCompoundTag(EntityPlayer.PERSISTED_NBT_TAG).getBoolean("hasDucked"))
@ -410,6 +411,13 @@ public class ModEventHandler
ArmorFSB.handleFall(event.entityPlayer);
}
@SubscribeEvent
public void onEntityJump(LivingJumpEvent event) {
if(event.entityLiving instanceof EntityPlayer)
ArmorFSB.handleJump((EntityPlayer) event.entityLiving);
}
@SubscribeEvent
public void onEntityFall(LivingFallEvent event) {

View File

@ -11,6 +11,7 @@ import com.hbm.entity.projectile.EntityChopperMine;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.GunConfiguration;
import com.hbm.handler.HTTPHandler;
import com.hbm.handler.HazmatRegistry;
import com.hbm.interfaces.IHoldableWeapon;
import com.hbm.interfaces.Spaghetti;
@ -353,8 +354,8 @@ public class ModEventHandlerClient {
SoyuzPronter.prontCapsule();
GL11.glRotated(System.currentTimeMillis() * 0.025 % 360, 0, -1, 0);
String msg = "your ad here";
String msg = HTTPHandler.capsule;
GL11.glTranslated(0, 3.75, 0);
GL11.glRotated(180, 1, 0, 0);
@ -368,13 +369,14 @@ public class ModEventHandlerClient {
GL11.glRotatef(rot, 0, 1, 0);
rot -= Minecraft.getMinecraft().fontRenderer.getCharWidth(c);
float width = Minecraft.getMinecraft().fontRenderer.getStringWidth(msg);
float scale = 5 / width;
rot -= Minecraft.getMinecraft().fontRenderer.getCharWidth(c) * scale * 50;
GL11.glTranslated(2, 0, 0);
GL11.glRotatef(-90, 0, 1, 0);
float scale = 0.03F;
GL11.glScalef(scale, scale, scale);
GL11.glDisable(GL11.GL_CULL_FACE);
Minecraft.getMinecraft().fontRenderer.drawString(String.valueOf(c), 0, 0, 0xff00ff);

View File

@ -355,6 +355,7 @@ public class ResourceManager {
//RTG
public static final ResourceLocation rtg_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/rtg.png");
public static final ResourceLocation rtg_cell_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/rtg_cell.png");
public static final ResourceLocation rtg_polonium_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/rtg_polonium.png");
//Anti Mass Spectrometer
public static final ResourceLocation ams_base_tex = new ResourceLocation(RefStrings.MODID, "textures/models/ams_base.png");

View File

@ -22,6 +22,8 @@ public class RenderRTG extends TileEntitySpecialRenderer {
if(te.getBlockType() == ModBlocks.machine_rtg_grey)
bindTexture(ResourceManager.rtg_tex);
else if(te.getBlockType() == ModBlocks.machine_powerrtg)
bindTexture(ResourceManager.rtg_polonium_tex);
else
bindTexture(ResourceManager.rtg_cell_tex);

View File

@ -3,6 +3,7 @@ package com.hbm.tileentity.machine;
import java.util.ArrayList;
import java.util.List;
import com.hbm.blocks.ModBlocks;
import com.hbm.interfaces.IConsumer;
import com.hbm.interfaces.ISource;
import com.hbm.lib.Library;
@ -13,7 +14,6 @@ public class TileEntityMachineMiniRTG extends TileEntity implements ISource {
public List<IConsumer> list = new ArrayList();
public long power;
public long maxPower = 1400;
boolean tact = false;
@Override
@ -21,10 +21,13 @@ public class TileEntityMachineMiniRTG extends TileEntity implements ISource {
if(!worldObj.isRemote) {
power += 70;
if(this.getBlockType() == ModBlocks.machine_powerrtg)
power += 2500;
else
power += 70;
if(power > maxPower)
power = maxPower;
if(power > getMaxPower())
power = getMaxPower();
tact = false;
ffgeuaInit();
@ -32,6 +35,14 @@ public class TileEntityMachineMiniRTG extends TileEntity implements ISource {
ffgeuaInit();
}
}
private int getMaxPower() {
if(this.getBlockType() == ModBlocks.machine_powerrtg)
return 50000;
return 1400;
}
@Override
public void ffgeuaInit() {