Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
  •  
  •  
  •  
14 changes: 4 additions & 10 deletions src/main/java/com/paneedah/mwc/asm/ClassInfo.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.paneedah.mwc.asm;

import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

Expand Down Expand Up @@ -50,8 +52,8 @@ public boolean equals(Object obj) {
}
}

private final String notchClassName;
private final String mcpClassName;
@Getter private final String notchClassName;
@Getter private final String mcpClassName;
private final Map<MethodSignature, String> notchMethodInfoMap = new HashMap<>();
private final Map<MethodSignature, String> notchSignatureMap = new HashMap<>();

Expand Down Expand Up @@ -142,14 +144,6 @@ public boolean methodMatches(
return methodName.equals(notchMethodName);
}

public String getNotchClassName() {
return notchClassName;
}

public String getMcpClassName() {
return mcpClassName;
}

public String getNotchMethodName(String mcpMethodName, String signature) {
return notchMethodInfoMap.get(new MethodSignature(mcpMethodName, signature));
}
Expand Down
74 changes: 37 additions & 37 deletions src/main/java/com/paneedah/mwc/asm/Interceptors.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@
EntityPlayer player = FMLClientHandler.instance().getClientPlayerEntity();


if (authenticFOV != 0.0f && MC.gameSettings.fovSetting == 80.0f) {
if (authenticFOV != 0 && MC.gameSettings.fovSetting == 80) {
MC.gameSettings.fovSetting = authenticFOV;
authenticFOV = 0.0f;
authenticFOV = 0;
}


Expand All @@ -94,9 +94,9 @@

if (MC.gameSettings.thirdPersonView == 0) {

if (MC.gameSettings.fovSetting != 80.0f) {
if (MC.gameSettings.fovSetting != 80) {
authenticFOV = MC.gameSettings.fovSetting;
MC.gameSettings.fovSetting = 80.0f;
MC.gameSettings.fovSetting = 80;
}


Expand Down Expand Up @@ -152,7 +152,7 @@

GL11.glTranslated(roll * 0.025, 0.0, 0.0);

GL11.glRotatef(-roll, 0.0f, 0.0f, 1.0f);
GL11.glRotatef(-roll, 0, 0, 1);


double iSL = QPTI.pti(vehicle.prevSideLean, vehicle.sideLean);
Expand Down Expand Up @@ -191,7 +191,7 @@
//Vec3d vcv = vehicle.getSolver().getVelocityVector().scale(0.1);
//GL11.glTranslated(vcv.x, vcv.y, vcv.z);

//MC.gameSettings.fovSetting = (float) (70f + ((vehicle.getSolver().currentRPM)/500.0f) + (vehicle.getRealSpeed()/2));
//MC.gameSettings.fovSetting = (float) (70f + ((vehicle.getSolver().currentRPM)/500) + (vehicle.getRealSpeed()/2));
Vec3d pV = player.getPositionVector();
//GL11.glTranslated(-pV.x, -pV.y, -pV.z);

Expand Down Expand Up @@ -394,7 +394,7 @@
return true;
}

float scalar = 0.0f;
float scalar = 0;

/*
if(ClientValueRepo.gunPow > 30) {
Expand All @@ -420,7 +420,7 @@
if (pwi == null || !pwi.isAimed()) {


float sMult = 1.0f;
float sMult = 1;
float speed = sMult;

float f = entityplayer.distanceWalkedModified - entityplayer.prevDistanceWalkedModified;
Expand All @@ -430,10 +430,10 @@

float xWiggle = LissajousCurve.getXOffsetOnCurve(3, 1, 2, Math.PI, f1);

GL11.glTranslatef(MathHelper.sin(f1 * (float) Math.PI * speed) * f2 * 0.5F, -Math.abs(MathHelper.cos(f1 * (float) Math.PI) * f2) * 0.5f, 0.0F);
GL11.glRotatef(MathHelper.sin(f1 * (float) Math.PI * speed) * f2 * 3.0F * sMult, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(Math.abs(MathHelper.cos((f1 * (float) Math.PI - 0.2F) * speed) * f2) * 5.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(f3 * sMult, 1.0F, 0.0F, 0.0F);
GL11.glTranslatef(MathHelper.sin(f1 * (float) Math.PI * speed) * f2 * 0.5F, -Math.abs(MathHelper.cos(f1 * (float) Math.PI) * f2) * 0.5f, 0);
GL11.glRotatef(MathHelper.sin(f1 * (float) Math.PI * speed) * f2 * 3 * sMult, 0, 0, 1);
GL11.glRotatef(Math.abs(MathHelper.cos((f1 * (float) Math.PI - 0.2F) * speed) * f2) * 5, 1, 0, 0);
GL11.glRotatef(f3 * sMult, 1, 0, 0);

/*
float f =entityplayer.distanceWalkedModified - entityplayer.prevDistanceWalkedModified;
Expand All @@ -443,10 +443,10 @@

float xWiggle = (float) LissajousCurve.getXOffsetOnCurve(3, 1, 2, Math.PI, f1);

GL11.glTranslatef(MathHelper.sin(f1 * (float)Math.PI*speed) * f2 * 0.5F, -Math.abs(MathHelper.cos(f1 * (float)Math.PI) * f2)*0.5f, 0.0F);
GL11.glRotatef(MathHelper.sin(f1 * (float)Math.PI*speed) * f2 * 3.0F*sMult, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(Math.abs(MathHelper.cos((f1 * (float)Math.PI - 0.2F)*speed) * f2) * 5.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(f3*sMult, 1.0F, 0.0F, 0.0F);
GL11.glTranslatef(MathHelper.sin(f1 * (float)Math.PI*speed) * f2 * 0.5F, -Math.abs(MathHelper.cos(f1 * (float)Math.PI) * f2)*0.5f, 0);
GL11.glRotatef(MathHelper.sin(f1 * (float)Math.PI*speed) * f2 * 3*sMult, 0, 0, 1);
GL11.glRotatef(Math.abs(MathHelper.cos((f1 * (float)Math.PI - 0.2F)*speed) * f2) * 5, 1, 0, 0);
GL11.glRotatef(f3*sMult, 1, 0, 0);
*/
} else {

Expand All @@ -455,11 +455,11 @@
float f1 = -(entityplayer.distanceWalkedModified + f * partialTicks);
float f2 = entityplayer.prevCameraYaw + (entityplayer.cameraYaw - entityplayer.prevCameraYaw) * partialTicks;
float f3 = entityplayer.prevCameraPitch + (entityplayer.cameraPitch - entityplayer.prevCameraPitch) * partialTicks;
GL11.glTranslatef(MathHelper.sin(f1 * (float) Math.PI) * f2 * 0.2F, -Math.abs(MathHelper.cos(f1 * (float) Math.PI) * f2) * 0.2f, 0.0F);
GL11.glRotatef(MathHelper.sin(f1 * (float) Math.PI) * f2 * 3.0F, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(Math.abs(MathHelper.cos(f1 * (float) Math.PI - 0.2F) * f2) * 5.0F, 1.0F, 0.0F, 0.0F);
GL11.glTranslatef(MathHelper.sin(f1 * (float) Math.PI) * f2 * 0.2F, -Math.abs(MathHelper.cos(f1 * (float) Math.PI) * f2) * 0.2f, 0);
GL11.glRotatef(MathHelper.sin(f1 * (float) Math.PI) * f2 * 3, 0, 0, 1);
GL11.glRotatef(Math.abs(MathHelper.cos(f1 * (float) Math.PI - 0.2F) * f2) * 5, 1, 0, 0);

GL11.glRotatef(f3, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(f3, 1, 0, 0);


}
Expand All @@ -479,9 +479,9 @@

float f2 = 5f / (f1 * f1 + 5f) - f1 * 0.01F;
f2 = f2 * f2;
GL11.glRotatef(((float) spreadableExposure.getTickCount() + partialTicks) * speed, 0.0F, 1.0F, 1.0F);
GL11.glScalef(1.0F / f2, 1.0F, 1.0F);
GL11.glRotatef(-((float) spreadableExposure.getTickCount() + partialTicks) * speed, 0.0F, 1.0F, 1.0F);
GL11.glRotatef(((float) spreadableExposure.getTickCount() + partialTicks) * speed, 0, 1, 1);
GL11.glScalef(1 / f2, 1, 1);
GL11.glRotatef(-((float) spreadableExposure.getTickCount() + partialTicks) * speed, 0, 1, 1);
spreadableExposure.incrementTickCount();
}
}
Expand Down Expand Up @@ -521,7 +521,7 @@

}

float appliedAmplitude = 0.0f;
float appliedAmplitude = 0;
if (MC.gameSettings.thirdPersonView != 0) {
appliedAmplitude = amplitude;
} else {
Expand All @@ -529,7 +529,7 @@
}

if (vehicle.getSolver().velocity.length() > 10) {
appliedAmplitude += vehicle.getSolver().getSideSlipAngle() / 45;

Check failure

Code scanning / CodeQL

Implicit narrowing conversion in compound assignment High

Implicit cast of source type double to narrower destination type
float
.
}

// System.out.println(vehicle.getSolver().getVelocityVector().length());
Expand All @@ -538,7 +538,7 @@
NoiseGeneratorPerlin ngo = new NoiseGeneratorPerlin(new Random(45302), 1);
double val = ngo.getValue(vehicle.posX, vehicle.posZ) / 25;
// System.out.println(val);
appliedAmplitude += val;

Check failure

Code scanning / CodeQL

Implicit narrowing conversion in compound assignment High

Implicit cast of source type double to narrower destination type
float
.
frequency += val * 2;
}

Expand All @@ -551,7 +551,7 @@


if (Math.abs(lastYawDelta) > 0.3) {
// GL11.glRotatef(-(float)lastYawDelta * 2f, 0.0F, 1.0f, 0.0f);
// GL11.glRotatef(-(float)lastYawDelta * 2f, 0, 1, 0);
}
} else {

Expand Down Expand Up @@ -599,29 +599,29 @@
EntityPlayer entitylivingbase = (EntityPlayer) MC.getRenderViewEntity();
float f = (float) entitylivingbase.hurtTime - partialTicks;

if (entitylivingbase.getHealth() <= 0.0F) {
if (entitylivingbase.getHealth() <= 0) {
float f1 = (float) entitylivingbase.deathTime + partialTicks;
GL11.glRotatef(40.0F - 8000.0F / (f1 + 200.0F), 0.0F, 0.0F, 1.0F);
GL11.glRotatef(40 - 8000 / (f1 + 200), 0, 0, 1);
}

if (f < 0.0F) {
if (f < 0) {
return allowDefaultEffect;
}

f = f / (float) entitylivingbase.maxHurtTime;
f = MathHelper.sin(f * f * f * f * (float) Math.PI);
float f2 = entitylivingbase.attackedAtYaw;
GL11.glRotatef(-f2, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-f2, 0, 1, 0);
SpreadableExposure spreadableExposure = CompatibleExposureCapability.getExposure(entitylivingbase, SpreadableExposure.class);

if (spreadableExposure != null) {
GL11.glRotatef(-f * 4.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(-f, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(-f * 4, 1, 0, 0);
GL11.glRotatef(-f, 0, 0, 1);
} else {
GL11.glRotatef(-f * 14.0F, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(-f * 14, 0, 0, 1);
}

GL11.glRotatef(f2, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(f2, 0, 1, 0);


return allowDefaultEffect;
Expand All @@ -634,11 +634,11 @@
//
// int i = 1;
//
// float f2 = 5.0F / (f1 * f1 + 5.0F) - f1 * 0.04F;
// float f2 = 5 / (f1 * f1 + 5) - f1 * 0.04F;
// f2 = f2 * f2;
// GlStateManager.rotate(((float)rendererUpdateCount + partialTicks) * (float)i, 0.0F, 1.0F, 1.0F);
// GlStateManager.scale(1.0F / f2, 1.0F, 1.0F);
// GlStateManager.rotate(-((float)rendererUpdateCount + partialTicks) * (float)i, 0.0F, 1.0F, 1.0F);
// GlStateManager.rotate(((float)rendererUpdateCount + partialTicks) * (float)i, 0, 1, 1);
// GlStateManager.scale(1 / f2, 1, 1);
// GlStateManager.rotate(-((float)rendererUpdateCount + partialTicks) * (float)i, 0, 1, 1);

//rendererUpdateCount++;
return allowDefaultEffect;
Expand Down
13 changes: 4 additions & 9 deletions src/main/java/com/paneedah/mwc/bases/ItemBase.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package com.paneedah.mwc.bases;

import com.paneedah.mwc.MWC;
import lombok.Getter;
import lombok.Setter;
import net.minecraft.item.Item;

import java.util.Arrays;

public class ItemBase extends Item {

int stackSize = 64;
String[] oreDictKeys;
@Setter int stackSize = 64;
@Getter String[] oreDictKeys;

public ItemBase(String registryName) {
setRegistryName(registryName);
Expand All @@ -19,10 +21,6 @@ public ItemBase(String registryName) {
setCreativeTab(MWC.BLOCKS_AND_INGOTS_TAB);
}

public void setStackSize(int stackSize) {
this.stackSize = stackSize;
}

/*
* OreDictionary Keys (compatibility)
* https://MCreator.net/wiki/ore-dictionary-names-list for commonly used OreDict names
Expand All @@ -43,7 +41,4 @@ public void addOreDictKey(String oreDictKey) {
this.oreDictKeys = newArray;
}

public String[] getOreDictKeys() {
return oreDictKeys;
}
}
30 changes: 15 additions & 15 deletions src/main/java/com/paneedah/mwc/entities/Entities.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ public static void init(ModContext modContext) {
.withAmbientSound("drawweapon")
// .withStepSound("step")
.withAiTask(1, e -> new EntityAISwimming(e))
.withAiTask(3, e -> new EntityAIAvoidEntity<>((EntityCreature) e, EntityWolf.class, 6.0F, 1.0D, 1.2D))
.withAiTask(4, e -> new EntityAIAttackRangedWeapon((EntityCustomMob) e, 1.0D, 10, 30.0F))
.withAiTask(3, e -> new EntityAIAvoidEntity<>((EntityCreature) e, EntityWolf.class, 6, 1.0D, 1.2D))
.withAiTask(4, e -> new EntityAIAttackRangedWeapon((EntityCustomMob) e, 1.0D, 10, 30))
.withAiTask(5, e -> new EntityAIWander((EntityCreature) e, 1.0D))
.withAiTask(6, e -> new EntityAIWatchClosest(e, EntityPlayer.class, 50.0F))
.withAiTask(6, e -> new EntityAIWatchClosest(e, EntityPlayer.class, 50))
.withAiTask(6, e -> new EntityAILookIdle(e))
// .withAiTask(7, e -> new EntityAIBreakDoor(e))

Expand Down Expand Up @@ -94,10 +94,10 @@ public static void init(ModContext modContext) {
.withAmbientSound("drawweapon")
// .withStepSound("step")
.withAiTask(1, e -> new EntityAISwimming(e))
.withAiTask(3, e -> new EntityAIAvoidEntity<>((EntityCreature) e, EntityWolf.class, 6.0F, 1.0D, 1.2D))
.withAiTask(4, e -> new EntityAIAttackRangedWeapon((EntityCustomMob) e, 1.0D, 10, 30.0F))
.withAiTask(3, e -> new EntityAIAvoidEntity<>((EntityCreature) e, EntityWolf.class, 6, 1.0D, 1.2D))
.withAiTask(4, e -> new EntityAIAttackRangedWeapon((EntityCustomMob) e, 1.0D, 10, 30))
.withAiTask(5, e -> new EntityAIWander((EntityCreature) e, 1.0D))
.withAiTask(6, e -> new EntityAIWatchClosest(e, EntityPlayer.class, 50.0F))
.withAiTask(6, e -> new EntityAIWatchClosest(e, EntityPlayer.class, 50))
.withAiTask(6, e -> new EntityAILookIdle(e))
.withAiTask(7, e -> new EntityAIBreakDoor(e))

Expand Down Expand Up @@ -132,15 +132,15 @@ public static void init(ModContext modContext) {
.withMaxHealth(80)
.withEntityIdSupplier(() -> 10012)
.withEquipmentOption(Guns.turretgun, EnumDifficulty.EASY, 0.1f)
.withPrimaryEquipmentDropChance(0.0f)
.withPrimaryEquipmentDropChance(0)
// .withSpawn(1, 5, 6, BiomeDictionary.Type.PLAINS, BiomeDictionary.Type.FOREST, BiomeDictionary.Type.HILLS)
// .withMaxTolerableLightBrightness(1f)
.withSpawnEgg(0x5A674F, 0x464039)
.withTexturedModelVariant("com.paneedah.mwc.models.Turret", "turret.png")
.withAmbientSound("turret_turn")
// .withStepSound("step")
.withMaxSpeed(0.0F) // 0.1-0.3 is normal speed
.withAiTask(1, e -> new EntityAIAttackRangedWeapon((EntityCustomMob) e, 1.0D, 1, 50.0F))
.withMaxSpeed(0) // 0.1-0.3 is normal speed
.withAiTask(1, e -> new EntityAIAttackRangedWeapon((EntityCustomMob) e, 1.0D, 1, 50))
.withAiTask(2, e -> new EntityAILookIdle(e))
.withCollidability(false)
.withDespawnability(false)
Expand Down Expand Up @@ -182,15 +182,15 @@ public static void init(ModContext modContext) {
.withMaxHealth(80)
.withEntityIdSupplier(() -> 10013)
.withEquipmentOption(Guns.turretgunupgraded, EnumDifficulty.EASY, 0.1f)
.withPrimaryEquipmentDropChance(0.0f)
.withPrimaryEquipmentDropChance(0)
// .withSpawn(1, 5, 6, BiomeDictionary.Type.PLAINS, BiomeDictionary.Type.FOREST, BiomeDictionary.Type.HILLS)
// .withMaxTolerableLightBrightness(1f)
.withSpawnEgg(0x5A674F, 0x464039)
.withTexturedModelVariant("com.paneedah.mwc.models.TurretBuff", "turretbuff.png")
.withAmbientSound("turret_turn")
// .withStepSound("step")
.withMaxSpeed(0.0F) // 0.1-0.3 is normal speed
.withAiTask(1, e -> new EntityAIAttackRangedWeapon((EntityCustomMob) e, 1.0D, 1, 50.0F))
.withMaxSpeed(0) // 0.1-0.3 is normal speed
.withAiTask(1, e -> new EntityAIAttackRangedWeapon((EntityCustomMob) e, 1.0D, 1, 50))
.withAiTask(2, e -> new EntityAILookIdle(e))
.withCollidability(false)
.withDespawnability(false)
Expand Down Expand Up @@ -232,15 +232,15 @@ public static void init(ModContext modContext) {
.withMaxHealth(80)
.withEntityIdSupplier(() -> 10014)
.withEquipmentOption(Guns.turretgunsilenced, EnumDifficulty.EASY, 0.1f)
.withPrimaryEquipmentDropChance(0.0f)
.withPrimaryEquipmentDropChance(0)
// .withSpawn(1, 5, 6, BiomeDictionary.Type.PLAINS, BiomeDictionary.Type.FOREST, BiomeDictionary.Type.HILLS)
// .withMaxTolerableLightBrightness(1f)
.withSpawnEgg(0x5A674F, 0x464039)
.withTexturedModelVariant("com.paneedah.mwc.models.turretsilenced", "turretsilenced.png")
.withAmbientSound("turret_turn")
// .withStepSound("step")
.withMaxSpeed(0.0F) // 0.1-0.3 is normal speed
.withAiTask(1, e -> new EntityAIAttackRangedWeapon((EntityCustomMob) e, 1.0D, 1, 50.0F))
.withMaxSpeed(0) // 0.1-0.3 is normal speed
.withAiTask(1, e -> new EntityAIAttackRangedWeapon((EntityCustomMob) e, 1.0D, 1, 50))
.withAiTask(2, e -> new EntityAILookIdle(e))
.withCollidability(false)
.withDespawnability(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ public Item createGun(CommonProxy commonProxy) {
.withPosition(-1.265000f, 4.065000f, -3.085000f)
.withRotation(0.000000f, 1.000000f, 6.300000f)
.withPivotPoint(-0.350000f, -2.900000f, -0.100000f)
.withScale(3.0F, 3.0F, 3.0F)
.withScale(3, 3, 3)
)

.withFirstPersonHandPositioning(
Expand All @@ -603,7 +603,7 @@ public Item createGun(CommonProxy commonProxy) {
new Transform()
.withPosition(1.050000f, 0.065000f, -0.500000f)
.withBBRotation(-8.1997F, -23.6991F, 57.7232F)
.withScale(2.6F, 2.6F, 4.0F)
.withScale(2.6F, 2.6F, 4)
.withPivotPoint(0, 0, 0),


Expand Down Expand Up @@ -813,7 +813,7 @@ public Item createGun(CommonProxy commonProxy) {
new Transform()
.withPosition(1.730000f, 0.065000f, -0.980000f)
.withRotation(93.414678f, 23.699100f, 15.553163f)
.withScale(2.6F, 2.6F, 4.0F)
.withScale(2.6F, 2.6F, 4)
.withPivotPoint(0.000000f, 0.000000f, 0.000000f)
.applyTransformations();
},
Expand Down
Loading
Loading