aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/plugin/fixes/vanilla
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gtPlusPlus/plugin/fixes/vanilla')
-rw-r--r--src/main/java/gtPlusPlus/plugin/fixes/vanilla/Core_VanillaFixes.java12
-rw-r--r--src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java28
-rw-r--r--src/main/java/gtPlusPlus/plugin/fixes/vanilla/music/MusicTocker.java28
3 files changed, 37 insertions, 31 deletions
diff --git a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/Core_VanillaFixes.java b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/Core_VanillaFixes.java
index 6d53f973bf..cc181756c0 100644
--- a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/Core_VanillaFixes.java
+++ b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/Core_VanillaFixes.java
@@ -87,14 +87,14 @@ public class Core_VanillaFixes implements IPlugin {
private void registerToOreDict(ItemStack aStack, String aString) {
if (aStack.getItem() == Items.blaze_rod) {
- mInstance.log(
- "Registering " + aStack.getDisplayName() + " to OreDictionary under the tag '" + aString + "'.");
+ mInstance
+ .log("Registering " + aStack.getDisplayName() + " to OreDictionary under the tag '" + aString + "'.");
} else {
mInstance.log(
- "Registering " + aStack.getDisplayName()
- + " to OreDictionary under the tag '"
- + aString
- + "'. (Added to Forge in 1.8.9)");
+ "Registering " + aStack.getDisplayName()
+ + " to OreDictionary under the tag '"
+ + aString
+ + "'. (Added to Forge in 1.8.9)");
}
ItemUtils.addItemToOreDictionary(aStack, aString);
}
diff --git a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java
index 2fa92951c7..60ab048ca3 100644
--- a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java
+++ b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java
@@ -27,11 +27,11 @@ public class VanillaBedHeightFix implements IBugFix {
m = ReflectionUtils.getMethod(EntityPlayer.class, "func_71018_a", int.class, int.class, int.class);
} else {
m = ReflectionUtils.getMethod(
- net.minecraft.entity.player.EntityPlayer.class,
- "sleepInBedAt",
- int.class,
- int.class,
- int.class);
+ net.minecraft.entity.player.EntityPlayer.class,
+ "sleepInBedAt",
+ int.class,
+ int.class,
+ int.class);
}
if (m != null) {
mSleepInBedAt = m;
@@ -60,16 +60,16 @@ public class VanillaBedHeightFix implements IBugFix {
int correctY = 256 + evt.y;
if (correctY <= 0) {
Logger.WARNING(
- "You're trying to sleep at y=" + evt.y
- + ", which is impossibly low. However, fixed y value is "
- + correctY
- + ", which is still below 0. Falling back to default behavior.");
+ "You're trying to sleep at y=" + evt.y
+ + ", which is impossibly low. However, fixed y value is "
+ + correctY
+ + ", which is still below 0. Falling back to default behavior.");
} else {
Logger.WARNING(
- "You're trying to sleep at y=" + evt.y
- + ". This is probably caused by overflow, stopping original event; retrying with y="
- + correctY
- + ".");
+ "You're trying to sleep at y=" + evt.y
+ + ". This is probably caused by overflow, stopping original event; retrying with y="
+ + correctY
+ + ".");
evt.result = EntityPlayer.EnumStatus.OTHER_PROBLEM;
try {
mSleepInBedAt.invoke(evt.entityPlayer, evt.x, correctY, evt.z);
@@ -79,7 +79,7 @@ public class VanillaBedHeightFix implements IBugFix {
}
} else if (!isFixValid()) {
Logger.WARNING(
- "Method sleepInBedAt was not found in EntityPlayer (wrong MC and/or Forge version?), unable to fix");
+ "Method sleepInBedAt was not found in EntityPlayer (wrong MC and/or Forge version?), unable to fix");
}
}
}
diff --git a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/music/MusicTocker.java b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/music/MusicTocker.java
index ed1d9890d7..c669f93f62 100644
--- a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/music/MusicTocker.java
+++ b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/music/MusicTocker.java
@@ -48,13 +48,15 @@ public class MusicTocker extends MusicTicker implements Runnable {
try {
Object m = f.get(mMinecraft);
if (m != null) {
- if (m instanceof MusicTocker || m.getClass().isAssignableFrom(getClass())) {
+ if (m instanceof MusicTocker || m.getClass()
+ .isAssignableFrom(getClass())) {
mPlugin.log("[BGM] Success.");
return true;
- } else if (m instanceof MusicTicker || m.getClass().isAssignableFrom(MusicTicker.class)) {
- mPlugin.log("[BGM] Found Vanilla MusicTicker, but may be instance of MusicTocker.");
- return true;
- }
+ } else if (m instanceof MusicTicker || m.getClass()
+ .isAssignableFrom(MusicTicker.class)) {
+ mPlugin.log("[BGM] Found Vanilla MusicTicker, but may be instance of MusicTocker.");
+ return true;
+ }
}
} catch (IllegalArgumentException | IllegalAccessException e) {}
@@ -88,25 +90,29 @@ public class MusicTocker extends MusicTicker implements Runnable {
MusicType musictype = this.mMinecraft.func_147109_W();
if (this.mSound != null) {
- if (!musictype.getMusicTickerLocation().equals(this.mSound.getPositionedSoundLocation())) {
- this.mMinecraft.getSoundHandler().stopSound(this.mSound);
+ if (!musictype.getMusicTickerLocation()
+ .equals(this.mSound.getPositionedSoundLocation())) {
+ this.mMinecraft.getSoundHandler()
+ .stopSound(this.mSound);
this.mTimeUntilNextTrack = MathHelper.getRandomIntegerInRange(this.mRandom, 0, getDelay() / 2);
updateInternalNumber();
Logger.INFO("[BGM] Adjusted BGM delay 1");
}
- if (!this.mMinecraft.getSoundHandler().isSoundPlaying(this.mSound)) {
+ if (!this.mMinecraft.getSoundHandler()
+ .isSoundPlaying(this.mSound)) {
this.mSound = null;
updateInternalSound(null);
this.mTimeUntilNextTrack = Math.min(
- MathHelper.getRandomIntegerInRange(this.mRandom, getDelay(), getDelay() * 2),
- this.mTimeUntilNextTrack);
+ MathHelper.getRandomIntegerInRange(this.mRandom, getDelay(), getDelay() * 2),
+ this.mTimeUntilNextTrack);
updateInternalNumber();
Logger.INFO("[BGM] Adjusted BGM delay 2");
}
} else if (this.mSound == null && this.mTimeUntilNextTrack-- <= 0) {
this.mSound = PositionedSoundRecord.func_147673_a(musictype.getMusicTickerLocation());
updateInternalSound(mSound);
- this.mMinecraft.getSoundHandler().playSound(this.mSound);
+ this.mMinecraft.getSoundHandler()
+ .playSound(this.mSound);
this.mTimeUntilNextTrack = getDelay();
updateInternalNumber();
Logger.INFO("[BGM] Adjusted BGM 3");