Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
cee2b88
Moved Latex Collector to AMT, improved shaders to use the lightmap
Pabilo8 May 14, 2026
6f3c645
Fixed import error in LawForm
Pabilo8 May 15, 2026
4e86d86
Fixed DiplomacyHandler crashing when game is suddenly forced to close
Pabilo8 May 18, 2026
5df2cf7
Started refactoring Machinegun, Mortar and Tripod periscope, fixed mo…
Pabilo8 May 18, 2026
96dfddd
More works on mounted weapons, unified placement logic
Pabilo8 May 23, 2026
3679ead
Added nightvision shader, mostly finished machinegun re-implementation
Pabilo8 May 26, 2026
f57ac02
Improved the visuals and logic behind EntityGasCloud, II gas fluid bu…
Pabilo8 May 27, 2026
438c993
Improved white phosphorus particle effects
Pabilo8 May 27, 2026
bb17e1a
Fixed seats bug in vehicles, added propeller sound loop for drones, a…
Pabilo8 May 28, 2026
85764f7
Added Field Anti-Air Gun model and basic functionality, added Field H…
Pabilo8 May 29, 2026
d667dd9
Expanded Deco GUI system to allow item and entity GUIs, moved Casing …
Pabilo8 May 31, 2026
172421a
Re-added core filling and production to Projectile Workshop, finished…
Pabilo8 Jun 1, 2026
fdd8a73
Standardised Request and Job naming in machines, fixed inserter task …
Pabilo8 Jun 1, 2026
2b5d4c4
Changed canister shells to trigger on contact with non-fragile materials
Pabilo8 Jun 1, 2026
ecb38da
Finished Arithmetic-Logic Machine GUI
Pabilo8 Jun 2, 2026
14507f7
Reworked Data Router to use a list of rules to manage data flow and a…
Pabilo8 Jun 2, 2026
f8877d5
Reworked Data Merger to use a rule list based approach, added new GUI…
Pabilo8 Jun 2, 2026
733ad60
Added missing upgrade 3D models and aicons
Pabilo8 Jun 2, 2026
70a07ee
Added basic inventory handling to Emplacement weapons
Pabilo8 Jun 3, 2026
fdb9cc9
Finished Config GUI page for Emplacement multiblock
Pabilo8 Jun 3, 2026
72631a4
More Emplacement works
Pabilo8 Jun 3, 2026
f3e7e84
Bumped up version, added more miscellaneous client-server sync fixes …
Pabilo8 Jun 3, 2026
54bafa5
Fixed camera entity registering
Pabilo8 Jun 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ body:
description: Select Immersive Intelligence version.
options:
- 0.3.1
- 0.3.1-dev4
- 0.3.1-dev3-test1
- 0.3.1-dev2
- 0.3.1-dev1
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mcmod_Contributors=Pabilo8,Carver,Sch
modForge=1.12.2-14.23.5.2847
modMappings=snapshot_20171003
#Project Data
modVersion=0.3.1-dev3-test1
modVersion=0.3.1-dev4
modGroup=pl.pabilo8
modName=immersiveintelligence
# Private Team II Maven
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public NBTTagCompound serializeNBT()
.withString("origin", origin)
.withString("destination", destination)
.withColor("color", IIColor.fromDye(color))
.withUUID("owner", owner)
.conditionally(owner!=null, tis -> tis.withUUID("owner", owner))
.withInt("batch_number", batchNumber)
.unwrap();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package pl.pabilo8.immersiveintelligence.api.ammo.enums;

import pl.pabilo8.immersiveintelligence.common.util.IIColor;
import pl.pabilo8.immersiveintelligence.common.util.ISerializableEnum;
import pl.pabilo8.immersiveintelligence.common.util.IIReference;
import pl.pabilo8.immersiveintelligence.common.util.ILocalizedEnum;

public enum ComponentRole implements ISerializableEnum
public enum ComponentRole implements ILocalizedEnum
{
GENERAL_PURPOSE(0xaaaaaa),
SHRAPNEL(0x3f4f57),
Expand Down Expand Up @@ -32,4 +33,10 @@ public IIColor getColor()
{
return color;
}

@Override
public String geLocaleKey()
{
return IIReference.DESCRIPTION_KEY+"bullet_type.";
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package pl.pabilo8.immersiveintelligence.api.ammo.enums;

import pl.pabilo8.immersiveintelligence.common.util.ISerializableEnum;
import pl.pabilo8.immersiveintelligence.common.util.IIReference;
import pl.pabilo8.immersiveintelligence.common.util.ILocalizedEnum;

import javax.annotation.Nonnull;
import java.util.Arrays;

public enum FuseType implements ISerializableEnum
public enum FuseType implements ILocalizedEnum
{
CONTACT('\u29b0'),
TIMED('\u29b1'),
Expand All @@ -18,11 +16,9 @@ public enum FuseType implements ISerializableEnum
this.symbol = symbol;
}

//TODO: 28.05.2024 replace with IIUtils.enumValue
@Nonnull
public static FuseType v(String s)
@Override
public String geLocaleKey()
{
String ss = s.toUpperCase();
return Arrays.stream(values()).filter(e -> e.name().equals(ss)).findFirst().orElse(CONTACT);
return IIReference.DESCRIPTION_KEY+"bullet_fuse.";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import pl.pabilo8.immersiveintelligence.api.ammo.enums.PropellantType;
import pl.pabilo8.immersiveintelligence.api.utils.ItemTooltipHandler;
import pl.pabilo8.immersiveintelligence.api.utils.ItemTooltipHandler.IAdvancedTooltipItem;
import pl.pabilo8.immersiveintelligence.common.IIUtils;
import pl.pabilo8.immersiveintelligence.common.entity.ammo.EntityAmmoBase;
import pl.pabilo8.immersiveintelligence.common.util.IIColor;
import pl.pabilo8.immersiveintelligence.common.util.easynbt.EasyNBT;
Expand Down Expand Up @@ -183,7 +184,7 @@ default FuseType getFuseType(ItemStack stack)
{
if(!ItemNBTHelper.hasKey(stack, NBT_FUSE))
makeDefault(stack);
return FuseType.v(ItemNBTHelper.getString(stack, NBT_FUSE));
return IIUtils.enumValue(FuseType.class, ItemNBTHelper.getString(stack, NBT_FUSE));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import pl.pabilo8.immersiveintelligence.common.IILogger;
import pl.pabilo8.immersiveintelligence.common.entity.ammo.EntityAmmoBase;
import pl.pabilo8.immersiveintelligence.common.entity.ammo.types.EntityAmmoProjectile;
import pl.pabilo8.immersiveintelligence.common.util.gun.GunAimCoordinate;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -115,7 +116,21 @@ public AmmoFactory(World world)
public AmmoFactory<E> setStack(ItemStack stack)
{
this.stack = stack;
this.ammo = ((IAmmoType<?, E>)stack.getItem());
this.ammo = this.ammo==null?((IAmmoType<?, E>)stack.getItem()): this.ammo;
return this;
}

/**
* Sets the ammo to create, used when the ammo type can't be determined directly from the stack, f.e. in turrets
*
* @param ammo The ammo to create
* @return The factory
*/
@SuppressWarnings("rawtypes")
public AmmoFactory<E> setAmmo(@Nonnull IAmmoType ammo)
{
//noinspection unchecked
this.ammo = (IAmmoType<?, E>)ammo;
return this;
}

Expand Down Expand Up @@ -195,6 +210,12 @@ public AmmoFactory<E> setPositionAndVelocity(Vec3d pos, Vec3d dir, float velocit
return this;
}

public AmmoFactory<E> setPositionAndVelocity(Vec3d positionVector, GunAimCoordinate aim, float offset, float velocity)
{
Vec3d target = aim.getTarget(0);
return setPositionAndVelocity(positionVector.add(target.scale(offset)), target, offset);
}

/**
* Sets the owner of the ammo
*
Expand Down Expand Up @@ -252,6 +273,8 @@ public AmmoFactory<E> setUseArtilleryAngles(boolean useArtilleryAngles)
return this;
}

//--- Ammo Entity Creation ---//

/**
* Builds the ammo based on passed data and spawns it in the world.
*
Expand All @@ -272,7 +295,7 @@ public E create()
public E create(@Nullable Consumer<E> action)
{
//Invalid ammo type
if(ammo==null)
if(ammo==null||stack==null||stack.isEmpty())
return null;

//No position or direction passed
Expand Down Expand Up @@ -356,4 +379,21 @@ public boolean isValidAmmo(ItemStack stack)
return false;
return stack.getItem()==ammo&&!((IAmmoTypeItem<?, ?>)ammo).isBulletCore(stack);
}

//--- Getters ---//

public World getWorld()
{
return world.get();
}

public Vec3d getPos()
{
return pos;
}

public Vec3d getDirection()
{
return dir;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package pl.pabilo8.immersiveintelligence.api.crafting;

import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.INBTSerializable;
Expand Down Expand Up @@ -30,7 +29,7 @@ private BulletComponentStack(String name, int amount, @Nonnull NBTTagCompound ta
{
this.name = name;
this.amount = amount;
this.tagCompound = tag;
this.tagCompound = tag.copy();

Optional<AmmoComponent> first = AmmoRegistry.getAllComponents().stream()
.filter(comp -> this.name.equals(comp.getName()))
Expand All @@ -41,21 +40,31 @@ private BulletComponentStack(String name, int amount, @Nonnull NBTTagCompound ta

public BulletComponentStack(AmmoComponent component, @Nullable NBTTagCompound tag)
{
this(component.getName(), 16, tag==null?new NBTTagCompound(): tag);
this(component, 16, tag);
}

public BulletComponentStack(AmmoComponent component, int amount, @Nullable NBTTagCompound tag)
{
this(component.getName(), amount, tag==null?new NBTTagCompound(): tag);
}

public BulletComponentStack()
{
this("", 0, new NBTTagCompound());
}

public BulletComponentStack copy()
{
return new BulletComponentStack(name, amount, tagCompound);
}

@Override
public NBTTagCompound serializeNBT()
{
NBTTagCompound nbt = new NBTTagCompound();
nbt.setString("name", name);
nbt.setInteger("amount", amount);
nbt.setTag("nbt", tagCompound);
nbt.setTag("nbt", tagCompound.copy());

return nbt;
}
Expand All @@ -65,7 +74,7 @@ public void deserializeNBT(NBTTagCompound nbt)
{
name = nbt.getString("name");
amount = nbt.getInteger("amount");
tagCompound = nbt.getCompoundTag("nbt");
tagCompound = nbt.getCompoundTag("nbt").copy();

Optional<AmmoComponent> first = AmmoRegistry.getAllComponents().stream()
.filter(comp -> this.name.equals(comp.getName()))
Expand All @@ -76,7 +85,7 @@ public void deserializeNBT(NBTTagCompound nbt)

public boolean isEmpty()
{
return name.isEmpty()||amount==0;
return name.isEmpty()||amount==0||component==null;
}

public boolean isFluid()
Expand All @@ -86,30 +95,34 @@ public boolean isFluid()

public boolean matches(ItemStack stack)
{
if(isEmpty()||component==null)
if(isEmpty())
return true;
if(stack.isEmpty()||component==null)
return false;

NBTTagCompound stackTag = stack.getTagCompound();
if(stackTag==null)
stackTag = new NBTTagCompound();

return component.getName().equals(name)&&this.tagCompound.equals(stackTag);
return component.getMaterial().matchesItemStackIgnoringSize(stack)&&this.tagCompound.equals(stackTag);
}

public boolean matches(FluidStack fs)
{
if(isEmpty())
return true;
if(fs==null||component==null||component.getMaterial().fluid==null)
return false;

NBTTagCompound stackTag = fs.tag==null?new NBTTagCompound(): fs.tag;

return fs.getFluid().getName().equals(name)&&this.tagCompound.equals(stackTag);
return fs.isFluidEqual(component.getMaterial().fluid)&&this.tagCompound.equals(stackTag);
}

public void subtract(int amount)
{
this.amount = Math.max(0, this.amount-amount);
if(amount==0)
if(this.amount==0)
{
tagCompound = new NBTTagCompound();
name = "";
Expand All @@ -135,7 +148,7 @@ public float getAmountPercentage()
@SideOnly(Side.CLIENT)
public String getTranslatedName()
{
return I18n.format("ie.manual.entry.bullet_component."+name);
return component!=null?component.getTranslatedName(): "";
}

public AmmoComponent getComponent()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,27 @@
**/
public class ProjectileWorkshopRecipe extends IIMultiblockRecipe
{
public static final String FILLING_RECIPE_NAME = "core_filling";
public static final ProjectileWorkshopRecipe CORE_FILLING = new ProjectileWorkshopRecipe();

@Nullable
public IAmmoTypeItem<?, ?> ammo;
public boolean isFilling;
public ItemStack effect, ingredient;
public ItemStack effect = ItemStack.EMPTY, ingredient = ItemStack.EMPTY;

/**
* Single hard-coded recipe used by Core Filler mode.
*/
private ProjectileWorkshopRecipe()
{
super(FILLING_RECIPE_NAME);
this.isFilling = true;

this.setTimeAndEnergy(
ProjectileWorkshop.fillingTime,
ProjectileWorkshop.fillingEnergyUsage
);
}

/**
* Production recipe
Expand All @@ -42,25 +60,9 @@ public ProjectileWorkshopRecipe(IAmmoTypeItem<?, ?> ammo, AmmoCore core, CoreTyp
);
}

//Filling recipe
/*public ProjectileWorkshopRecipe(ItemStack inputStack, BulletComponentStack component)
{
assert inputStack.getItem() instanceof IAmmoTypeItem;

this.ammo = (IAmmoTypeItem<?, ?>)inputStack.getItem();
this.isFilling = true;

this.totalProcessTime = ProjectileWorkshop.fillingTime;
this.energyPerTick = ProjectileWorkshop.fillingEnergyUsage;

this.effect = inputStack.copy();
this.effect.setCount(1);
ammo.addComponents(this.effect, component.getComponent(), component.tagCompound);
}*/

public ItemStack getEffect()
{
return effect;
return effect.copy();
}

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static void registerDataTypes()
//number types
registerType("integer", DataTypeInteger.class, DataTypeInteger::new, IIColor.fromPackedRGB(0x26732e), false);
registerType("float", DataTypeFloat.class, DataTypeFloat::new, IIColor.fromPackedRGB(0x0d6b68), false);
registerType("vector", DataTypeVector.class, DataTypeVector::new, IIColor.fromPackedRGB(0x9d8900), false);
registerType("vector", DataTypeVector.class, DataTypeVector::new, IIColor.fromPackedRGB(0x9d8900), true);
registerGenericType("number", NumericDataType.class);

//text types
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ public void valueFromNBT(NBTTagCompound nbt)
{
this.operation = IIDataOperationUtils.getOperationInstance(nbt.getString("Operation"));
this.meta = this.operation.getMeta();
this.requiredVariable = nbt.getString("requiredVariable").charAt(0);
String required = nbt.getString("requiredVariable");
this.requiredVariable = required.isEmpty()?' ': required.charAt(0);

this.data = new DataType[meta.allowedTypes().length];
for(int i = 0; i < meta.allowedTypes().length; i++)
Expand Down
Loading
Loading