Merge branch 'HbmMods:master' into master

This commit is contained in:
pheo 2025-04-29 22:01:48 +01:00 committed by GitHub
commit f74b5a337c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 5768 additions and 28 deletions

View File

@ -4,3 +4,5 @@
## Fixed ## Fixed
* Fixed a potential crash caused by cargo dropships landing on cargo docks with no satellite chip installed * Fixed a potential crash caused by cargo dropships landing on cargo docks with no satellite chip installed
* Fixed potential crash related to hazard handling for dropped items
* Fixed errors thrown when loading in old system bullet entities

View File

@ -581,27 +581,14 @@ public class EntityBulletBaseNT extends EntityThrowableInterp implements IBullet
} }
@Override @Override
public void readEntityFromNBT(NBTTagCompound nbt) { public boolean writeToNBTOptional(NBTTagCompound nbt) {
super.readEntityFromNBT(nbt); return false;
int cfg = nbt.getInteger("config");
this.config = BulletConfigSyncingUtil.pullConfig(cfg);
this.dataWatcher.updateObject(16, (byte)this.config.style);
this.dataWatcher.updateObject(17, (byte)this.config.trail);
if(this.config == null) {
this.setDead();
return;
}
this.overrideDamage = nbt.getFloat("damage");
this.dataWatcher.updateObject(18, cfg);
} }
@Override @Override
public void writeEntityToNBT(NBTTagCompound nbt) { public void readEntityFromNBT(NBTTagCompound nbt) {
super.writeEntityToNBT(nbt); super.readEntityFromNBT(nbt);
nbt.setInteger("config", dataWatcher.getWatchableObjectInt(18)); this.setDead();
nbt.setFloat("damage", this.overrideDamage);
} }
public static interface IBulletHurtBehaviorNT { public void behaveEntityHurt(EntityBulletBaseNT bullet, Entity hit); } public static interface IBulletHurtBehaviorNT { public void behaveEntityHurt(EntityBulletBaseNT bullet, Entity hit); }

View File

@ -349,13 +349,15 @@ public class ModEventHandler {
Map<Integer, List<WeightedRandomObject>> slotPools = new HashMap<>(); Map<Integer, List<WeightedRandomObject>> slotPools = new HashMap<>();
float soot = PollutionHandler.getPollution(entity.worldObj, MathHelper.floor_double(event.x), MathHelper.floor_double(event.y), MathHelper.floor_double(event.z), PollutionType.SOOT); //uhfgfg
if(entity instanceof EntityZombie) { if(entity instanceof EntityZombie) {
if(world.rand.nextFloat() < 0.005F) { // full hazmat zombine if(world.rand.nextFloat() < 0.005F && soot > 2) { // full hazmat zombine
equipFullSet(entity, ModItems.hazmat_helmet, ModItems.hazmat_plate, ModItems.hazmat_legs, ModItems.hazmat_boots); equipFullSet(entity, ModItems.hazmat_helmet, ModItems.hazmat_plate, ModItems.hazmat_legs, ModItems.hazmat_boots);
return; return;
} }
if(world.rand.nextFloat() < 0.005F) { // full security zombine if(world.rand.nextFloat() < 0.005F && soot > 20) { // full security zombine
equipFullSet(entity, ModItems.security_helmet, ModItems.security_plate, ModItems.security_legs, ModItems.security_boots); equipFullSet(entity, ModItems.security_helmet, ModItems.security_plate, ModItems.security_legs, ModItems.security_boots);
return; return;
} }
@ -387,8 +389,6 @@ public class ModEventHandler {
})); }));
} else if(entity instanceof EntitySkeleton) { } else if(entity instanceof EntitySkeleton) {
float soot = PollutionHandler.getPollution(entity.worldObj,
MathHelper.floor_double(event.x), MathHelper.floor_double(event.y), MathHelper.floor_double(event.z), PollutionType.SOOT); //uhfgfg
slotPools.put(4, createSlotPool(12000, new Object[][]{ slotPools.put(4, createSlotPool(12000, new Object[][]{
{ModItems.gas_mask_m65, 16}, {ModItems.gas_mask_olde, 12}, {ModItems.mask_of_infamy, 8}, {ModItems.gas_mask_m65, 16}, {ModItems.gas_mask_olde, 12}, {ModItems.mask_of_infamy, 8},
@ -440,7 +440,7 @@ public class ModEventHandler {
} }
private void assignItemsToEntity(EntityLivingBase entity, Map<Integer, List<WeightedRandomObject>> slotPools) { public void assignItemsToEntity(EntityLivingBase entity, Map<Integer, List<WeightedRandomObject>> slotPools) {
for (Map.Entry<Integer, List<WeightedRandomObject>> entry : slotPools.entrySet()) { for (Map.Entry<Integer, List<WeightedRandomObject>> entry : slotPools.entrySet()) {
int slot = entry.getKey(); int slot = entry.getKey();
List<WeightedRandomObject> pool = entry.getValue(); List<WeightedRandomObject> pool = entry.getValue();
@ -655,7 +655,10 @@ public class ModEventHandler {
if(event.phase == Phase.END) { if(event.phase == Phase.END) {
for(Object e : event.world.loadedEntityList) { List loadedEntityList = new ArrayList();
loadedEntityList.addAll(event.world.loadedEntityList); // ConcurrentModificationException my balls
for(Object e : loadedEntityList) {
if(e instanceof EntityItem) { if(e instanceof EntityItem) {
EntityItem item = (EntityItem) e; EntityItem item = (EntityItem) e;

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB