mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
flixes
This commit is contained in:
parent
d4d5340a33
commit
bd59ae5970
17
changelog
17
changelog
@ -1,16 +1,3 @@
|
||||
## Changed
|
||||
* Changed PA power draw penalties from x5 to x10
|
||||
* Particles will now crash instantly if the dipole has both penalties in effect (underspeed + undersized ring)
|
||||
* This means that undersized accelerators require appropriate tier coils, and overtiered accelerators (i.e. high coils for low velocities) need to meet the size requirement
|
||||
* Accelerators where both penalties take effect are usually tiny ones with single tier coils (usually the highest tier required) which are lame
|
||||
* DNT nano suit helmets now require quantum circuits instead of bismuth ones
|
||||
* Made particle capsules more expensive
|
||||
* Since invalid recipes no longer void containers, this shouldn't really be a huge deal
|
||||
* Both quadrupoles and dipoles now have a power cap of 2.5MHE
|
||||
* RFCs now use 250kHE per pass (instead of 100k)
|
||||
* Heavy water extraction now has a NEI handler
|
||||
|
||||
## Fixed
|
||||
* Fixed particle detector not consuming power
|
||||
* Fixed empty capsules not being recoverable from the color coded slots on the particle source
|
||||
* Fixed particle detector nor charging from batteries
|
||||
* Fixed items being annihilated when shift clicking them into the particle source
|
||||
* Fixed packet optimization not allowing packets to be sent when the day night cycle is halted
|
||||
@ -3,6 +3,7 @@ package com.hbm.inventory.container;
|
||||
import com.hbm.inventory.SlotTakeOnly;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPASource;
|
||||
import com.hbm.util.InventoryUtil;
|
||||
|
||||
import api.hbm.energymk2.IBatteryItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -59,9 +60,9 @@ public class ContainerPASource extends Container {
|
||||
} else {
|
||||
|
||||
if(rStack.getItem() instanceof IBatteryItem || rStack.getItem() == ModItems.battery_creative) {
|
||||
if(!this.mergeItemStack(stack, 0, 1, false)) return null;
|
||||
if(!InventoryUtil.mergeItemStack(this.inventorySlots, stack, 0, 1, false)) return null;
|
||||
} else {
|
||||
if(!this.mergeItemStack(stack, 1, 3, false)) return null;
|
||||
if(!InventoryUtil.mergeItemStack(this.inventorySlots, stack, 1, 3, false)) return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.hbm.items;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
@ -14,6 +15,7 @@ import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
public class ItemCustomLore extends Item {
|
||||
|
||||
@ -104,4 +106,121 @@ public class ItemCustomLore extends Item {
|
||||
setTextureName(RefStrings.MODID + ':' + uloc);
|
||||
return super.setUnlocalizedName(uloc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
if(stack.getItem() == ModItems.undefined && stack.getItemDamage() != 99) return ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim();
|
||||
|
||||
return name.getResult();
|
||||
}
|
||||
|
||||
public static String[] names = new String[] {
|
||||
"THE DEFAULT", "NEXT ONE", "ANOTHER ONE", "NON-STANDARD NAME", "AMBIGUOUS TITLE", "SHORT"
|
||||
};
|
||||
|
||||
public static Random rand = new Random();
|
||||
public static int currentIndex = 0;
|
||||
public static ScramblingName name = new ScramblingName(names[0]);
|
||||
|
||||
public static void updateSystem() {
|
||||
name.updateTick(names);
|
||||
}
|
||||
|
||||
/**
|
||||
* A surprise tool we need for later
|
||||
* @author hbm
|
||||
*/
|
||||
public static class ScramblingName {
|
||||
|
||||
public String previous;
|
||||
public String next;
|
||||
public String[] previousFrags;
|
||||
public String[] nextFrags;
|
||||
public String[] frags;
|
||||
public int[] mask;
|
||||
public int age = 0;
|
||||
|
||||
public ScramblingName(String init) {
|
||||
previous = next = init;
|
||||
frags = init.split("");
|
||||
mask = new int[frags.length];
|
||||
previousFrags = chop(previous, frags.length);
|
||||
nextFrags = chop(next, frags.length);
|
||||
}
|
||||
|
||||
public String getResult() {
|
||||
return String.join("", frags);
|
||||
}
|
||||
|
||||
public void updateTick(String[] nextNames) {
|
||||
age++;
|
||||
try {
|
||||
//pick new name
|
||||
if(age % 200 == 0) nextName(nextNames);
|
||||
//run substitution
|
||||
if(age % 5 == 0) scramble();
|
||||
} catch(Exception ex) { }
|
||||
}
|
||||
|
||||
public void nextName(String[] nextNames) {
|
||||
if(nextNames.length < 2) return;
|
||||
|
||||
this.previous = this.next;
|
||||
|
||||
String initial = next;
|
||||
//keep choosing new names until it's different
|
||||
while(initial.equals(next)) {
|
||||
next = nextNames[rand.nextInt(nextNames.length)];
|
||||
}
|
||||
|
||||
//frag setup
|
||||
int length = Math.min(previous.length(), next.length());
|
||||
this.previousFrags = chop(previous, length);
|
||||
this.frags = chop(previous, length);
|
||||
this.nextFrags = chop(next, length);
|
||||
mask = new int[length];
|
||||
}
|
||||
|
||||
public void scramble() {
|
||||
|
||||
//all fragments that haven't been substituted
|
||||
List<Integer> indices = new ArrayList();
|
||||
|
||||
for(int i = 0; i < mask.length; i++) {
|
||||
int m = mask[i];
|
||||
//mask 0 means not yet processed
|
||||
if(m == 0) indices.add(i);
|
||||
//mask 1-5 means obfuscated
|
||||
if(m > 0 && m <= 5) mask[i]++;
|
||||
//mask >5 means replaced
|
||||
if(m > 5) frags[i] = nextFrags[i];
|
||||
}
|
||||
|
||||
//if there's at least one index listed, start processing
|
||||
if(!indices.isEmpty()) {
|
||||
int toSwitch = indices.get(rand.nextInt(indices.size()));
|
||||
mask[toSwitch] = 1;
|
||||
frags[toSwitch] = EnumChatFormatting.OBFUSCATED + previousFrags[toSwitch] + EnumChatFormatting.RESET;
|
||||
}
|
||||
}
|
||||
|
||||
public String[] chop(String name, int parts) {
|
||||
if(parts == name.length()) return name.split("");
|
||||
|
||||
double index = 0;
|
||||
double incrementPerStep = (double) name.length() / (double) parts;
|
||||
List<String> slices = new ArrayList();
|
||||
|
||||
for(int i = 0; i < parts; i++) {
|
||||
int end = (i == parts - 1) ? name.length() : (int) (index + incrementPerStep);
|
||||
slices.add(name.substring((int) index, end));
|
||||
index += incrementPerStep;
|
||||
}
|
||||
|
||||
String[] chop = slices.toArray(new String[parts]);
|
||||
//System.out.println("Chopped " + name + " into " + parts + " pieces: " + chop);
|
||||
|
||||
return chop;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1500,6 +1500,7 @@ public class ModItems {
|
||||
public static Item gun_hangman;
|
||||
public static Item gun_bolter;
|
||||
public static Item gun_folly;
|
||||
public static Item gun_aberrator;
|
||||
public static Item gun_double_barrel;
|
||||
public static Item gun_double_barrel_sacred_dragon;
|
||||
|
||||
@ -6493,6 +6494,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(gun_hangman, gun_hangman.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_bolter, gun_bolter.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_folly, gun_folly.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_aberrator, gun_aberrator.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_double_barrel, gun_double_barrel.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gun_double_barrel_sacred_dragon, gun_double_barrel_sacred_dragon.getUnlocalizedName());
|
||||
|
||||
|
||||
@ -65,6 +65,7 @@ public class GunFactory {
|
||||
XFactoryFolly.init();
|
||||
XFactoryTurret.init();
|
||||
XFactory10ga.init();
|
||||
XFactory35800.init();
|
||||
|
||||
/// PROXY BULLSHIT ///
|
||||
MainRegistry.proxy.registerGunCfg();
|
||||
@ -124,6 +125,7 @@ public class GunFactory {
|
||||
|
||||
public static enum EnumAmmoSecret {
|
||||
FOLLY_SM, FOLLY_NUKE,
|
||||
M44_EQUESTRIAN, G12_EQUESTRIAN, BMG50_EQUESTRIAN
|
||||
M44_EQUESTRIAN, G12_EQUESTRIAN, BMG50_EQUESTRIAN,
|
||||
P35_800
|
||||
}
|
||||
}
|
||||
|
||||
@ -1278,4 +1278,11 @@ public class Orchestras {
|
||||
if(timer == 2) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 1F, 1F);
|
||||
}
|
||||
};
|
||||
|
||||
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_ABERRATOR = (stack, ctx) -> {
|
||||
EntityLivingBase entity = ctx.entity;
|
||||
if(entity.worldObj.isRemote) return;
|
||||
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
|
||||
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
|
||||
};
|
||||
}
|
||||
|
||||
@ -0,0 +1,43 @@
|
||||
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.ItemGunBaseNT.WeaponQuality;
|
||||
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmoSecret;
|
||||
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.util.DamageResistanceHandler.DamageClass;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class XFactory35800 {
|
||||
|
||||
public static BulletConfig p35800;
|
||||
|
||||
public static void init() {
|
||||
|
||||
p35800 = new BulletConfig().setItem(EnumAmmoSecret.P35_800).setupDamageClass(DamageClass.LASER).setBeam().setSpread(0.0F).setLife(5).setRenderRotations(false).setOnBeamImpact(BulletConfig.LAMBDA_STANDARD_BEAM_HIT);
|
||||
|
||||
ModItems.gun_aberrator = new ItemGunBaseNT(WeaponQuality.SECRET, new GunConfig()
|
||||
.dura(2_000).draw(10).inspect(26).reloadSequential(true).crosshair(Crosshair.CIRCLE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(50F).delay(8).reload(44).jam(36).sound("hbm:weapon.fire.laser", 1.0F, 1.0F)
|
||||
.mag(new MagazineFullReload(0, 24).addConfigs(p35800))
|
||||
.offset(0.75, -0.0625 * 1.5, -0.1875)
|
||||
.setupStandardFire())
|
||||
.setupStandardConfiguration()
|
||||
.anim(LAMBDA_ABERRATOR).orchestra(Orchestras.ORCHESTRA_ABERRATOR)
|
||||
).setUnlocalizedName("gun_aberrator");
|
||||
}
|
||||
|
||||
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_ABERRATOR = (stack, type) -> {
|
||||
return null;
|
||||
};
|
||||
}
|
||||
@ -25,6 +25,7 @@ import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.gui.GUIArmorTable;
|
||||
import com.hbm.inventory.gui.GUIScreenPreview;
|
||||
import com.hbm.inventory.gui.GUIScreenWikiRender;
|
||||
import com.hbm.items.ItemCustomLore;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.armor.*;
|
||||
import com.hbm.items.machine.ItemDepletedFuel;
|
||||
@ -1389,6 +1390,8 @@ public class ModEventHandlerClient {
|
||||
client.sendQueue.addToSendQueue(new C0CPacketInput(client.moveStrafing, client.moveForward, client.movementInput.jump, client.movementInput.sneak));
|
||||
}
|
||||
}
|
||||
|
||||
if(event.phase == event.phase.END) ItemCustomLore.updateSystem();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
@ -77,7 +77,7 @@ public class TileEntityLoadedBase extends TileEntity implements ILoadedTile, IBu
|
||||
// In my testing, this can be reliably reproduced with a full fluid barrel, for instance.
|
||||
// I think it might be fixable by doing something with getDescriptionPacket() and onDataPacket(),
|
||||
// but this sidesteps the problem for the mean time.
|
||||
if(preBuf.equals(lastPackedBuf) && this.worldObj.getWorldTime() % 20 != 0) return;
|
||||
if(preBuf.equals(lastPackedBuf) && this.worldObj.getTotalWorldTime() % 20 != 0) return;
|
||||
|
||||
this.lastPackedBuf = preBuf.copy();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user