Skip to content

Commit

Permalink
ok so i cant update to new hex version,
Browse files Browse the repository at this point in the history
got nixes actually hitting stuff now lol
  • Loading branch information
kineticneticat committed Nov 26, 2024
1 parent 37325e0 commit 403ad63
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 105 deletions.
1 change: 1 addition & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dependencies {

modCompileOnly "at.petra-k.paucal:paucal-common-$minecraftVersion:$paucalVersion"
modCompileOnly "at.petra-k.hexcasting:hexcasting-fabric-$minecraftVersion:$hexcastingVersion"
modApi "com.samsthenerd.inline:inline-common:$minecraftVersion-$inlineVersion"
modCompileOnly "vazkii.patchouli:Patchouli-xplat:$minecraftVersion-$patchouliVersion"
modCompileOnly files("${rootProject.rootDir}/lib/moreiotas-fabric-1.20.1-0.1.0-4.jar")
implementation group: "org.jblas", name: "jblas", version: "1.2.5"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ object OpSetNixAcceleration : SpellAction {
override fun execute(args: List<Iota>, env: CastingEnvironment): SpellAction.Result {
val nix = args.getEntity(0, argc)
// force acc to be mag 1
val acc = args.getVec3(1, argc).normalize()
var acc = args.getVec3(1, argc)

acc = if (acc.lengthSqr() <25) acc else acc.normalize().scale(5.0)

if ( nix !is NixEntity) throw MishapBadEntity.of(nix, "nix")
env.assertEntityInRange(nix)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,7 @@ public static void registerEntities (BiConsumer<EntityType<?>, ResourceLocation>
.updateInterval(1)
.build(id("holdout").toString())
);
public static final EntityType<LaTeXEntity> LATEX = register(
"latex",
EntityType.Builder.of(LaTeXEntity::new, MobCategory.MISC)
.sized(.5f, .5f)
.clientTrackingRange(32)
.updateInterval(1)
.build(id("latex").toString())

);
private static <T extends Entity> EntityType<T> register (String id, EntityType<T> type) {
var old = ENTITIES.put(id(id), type);
if (old != null) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.ClipContext;
import net.minecraft.world.entity.projectile.ProjectileUtil;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.EntityHitResult;
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
import org.joml.Vector3f;

Expand All @@ -26,6 +25,8 @@ public NixEntity(EntityType<?> entityType, Level level) {
noPhysics = false;
}

private static final double dt = 0.01;

private static final String TAG_PIGMENT = "pigment";
private static final String TAG_ACCELERATION = "acceleration";
private static final String TAG_AGE = "age";
Expand Down Expand Up @@ -67,9 +68,9 @@ protected void addAdditionalSaveData(CompoundTag compoundTag) {

@Override
public void tick() {
age();
// age();
harm();
move(0.01f);
move();
}

public void age() {
Expand All @@ -82,25 +83,37 @@ public void age() {
}

public void harm() {
HitResult hitResult = level().clip(new ClipContext(this.position(), this.getDeltaMovement(), ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, this ));
if (hitResult.getType() != HitResult.Type.ENTITY) {
return;
}
// due to above, it must be an entity therefore shut up
//noinspection DataFlowIssue
EntityHitResult ehr = (EntityHitResult) hitResult;
// HitResult hitResult = level().clip(new ClipContext(this.position(), this.getDeltaMovement(), ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, this ));
// Complexhex.LOGGER.info(hitResult);
// if (hitResult.getType() != HitResult.Type.ENTITY) {
// return;
// }
// // due to above, it must be an entity therefore shut up
// //noinspection DataFlowIssue
// EntityHitResult ehr = (EntityHitResult) hitResult;

EntityHitResult ehr = ProjectileUtil.getEntityHitResult(
this.level(),
this,
this.position(),
this.position().add(this.getDeltaMovement().scale(dt)),
this.getBoundingBox().expandTowards(this.getDeltaMovement().scale(dt)).inflate(1.0),
Entity::canBeHitByProjectile);
if (ehr == null) return;
Entity hit = ehr.getEntity();
Complexhex.LOGGER.info(hit);
DamageSource damageSource = damageSources().generic();
hit.hurt(damageSource, damage());
float amt = damage();
Complexhex.LOGGER.info("amt: %f, speed: %f".formatted(amt, this.getDeltaMovement().scale(dt).length()));
hit.hurt(damageSource, amt);
}

public float damage() {
// 1 second of full acceleration per 2 hearts of damage
return (float) (getDeltaMovement().length() * 0.1f);
}

public void move(double dt) {
public void move() {
// ds = v*dt + 1/2 * a * dt^2
setPos(
position().add(
Expand Down
2 changes: 2 additions & 0 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ dependencies {
exclude module: "phosphor"
}

modApi "com.samsthenerd.inline:inline-fabric:$minecraftVersion-$inlineVersion"

modImplementation "at.petra-k.paucal:paucal-fabric-${minecraftVersion}:${paucalVersion}"
modImplementation "vazkii.patchouli:Patchouli:${minecraftVersion}-${patchouliVersion}-FABRIC"

Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ cardinalComponentsVersion=5.2.1
serializationHooksVersion=0.4.99999
entityReachVersion=2.4.0
trinketsVersion=3.7.0
inlineVersion=1.0.2-51

# other
satin_version=1.14.0
Expand Down

0 comments on commit 403ad63

Please sign in to comment.