Skip to content

Commit

Permalink
Deprecate the xml stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Sollace committed Feb 27, 2019
1 parent 60a083e commit a8aade5
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
7 changes: 4 additions & 3 deletions src/main/java/eu/ha3/matmos/core/event/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,14 @@ public void playSound(float volMod, float pitchMod) {

float volume = volMax - volMin;
float pitch = pitchMax - pitchMin;

volume = volMin + (volume > 0 ? random.nextFloat() * volume : 0);
pitch = pitchMin + (pitch > 0 ? random.nextFloat() * pitch : 0);

String path = paths.get(random.nextInt(paths.size()));
volume *= volMod;
pitch *= pitchMod;

volume = volume * volMod;
pitch = pitch * pitchMod;
String path = paths.get(random.nextInt(paths.size()));

relay.playSound(path, volume, pitch, distance);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import eu.ha3.matmos.serialisation.LegacyXMLExpansions_Engine1;
import eu.ha3.matmos.serialisation.expansion.SerialRoot;

@Deprecated
public class LegacyXMLLoadingAgent implements LoadingAgent {
private static final Gson gson = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create();

Expand Down
19 changes: 13 additions & 6 deletions src/main/java/eu/ha3/matmos/data/modules/player/ModuleMotion.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,19 @@ public ModuleMotion(DataPackage data) {
protected void doProcess() {
EntityPlayer player = getPlayer();

int mxx = (int)Math.round(player.motionX * 1000);
int mzz = (int)Math.round(player.motionZ * 1000);

setValue("x_1k", mxx);
setValue("x_1k", (int)Math.round(player.motionX * 1000));
setValue("y_1k", (int)Math.round(player.motionY * 1000));
setValue("z_1k", mzz);
setValue("sqrt_xx_zz", (int)Math.floor(Math.sqrt(mxx * mxx + mzz * mzz)));
setValue("z_1k", (int)Math.round(player.motionZ * 1000));
setValue("sqrt_xx_zz", (int)Math.floor(Math.sqrt(
Math.pow(player.motionX, 2)
+ Math.pow(player.motionZ, 2)
))
);
setValue("sqrt_xx_yy_zz", (int)Math.floor(Math.sqrt(
Math.pow(player.motionX, 2)
+ Math.pow(player.motionY, 2)
+ Math.pow(player.motionZ, 2)
))
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import eu.ha3.matmos.data.modules.ModuleProcessor;
import eu.ha3.matmos.util.math.Numbers;

@Deprecated
public class LegacySheetIndex_Engine0to1 implements SheetIndex {
private static final Map<String, LegacyMapping> forward;
private static final Map<String, LegacyMapping> blocks;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import net.minecraft.item.Item;
import net.sf.practicalxml.DomUtil;

@Deprecated
public class LegacyXMLExpansions_Engine1 {
private static final String AS_ITEM = "__AS_ITEM";
private static final String AS_BLOCK = "__AS_BLOCK";
Expand Down

0 comments on commit a8aade5

Please sign in to comment.