mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-16 10:44:47 +00:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9443e23ab8 | ||
|
|
30958c201a | ||
|
|
1967d7212a |
No files matched your search
@@ -3,9 +3,9 @@ name: Build and test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master, main ]
|
||||
branches: [ master, main, release/** ]
|
||||
push:
|
||||
branches: [ master, main ]
|
||||
branches: [ master, main, release/** ]
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
|
||||
@@ -2,6 +2,7 @@ package crazypants.enderio.config;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -279,6 +280,8 @@ public final class Config {
|
||||
public static double darkSteelGliderHorizontalSpeed = 0.03;
|
||||
public static double darkSteelGliderVerticalSpeed = -0.05;
|
||||
public static double darkSteelGliderVerticalSpeedSprinting = -0.15;
|
||||
public static int[] darkSteelGliderDimensionBlocklist = {};
|
||||
public static HashSet<Integer> darkSteelGliderDimensionBlocklistHash = new HashSet<>();
|
||||
|
||||
public static int darkSteelGogglesOfRevealingCost = 10;
|
||||
|
||||
@@ -1580,6 +1583,11 @@ public final class Config {
|
||||
darkSteelGliderVerticalSpeedSprinting,
|
||||
"Rate of altitude loss when sprinting and gliding.")
|
||||
.getDouble(darkSteelGliderVerticalSpeedSprinting);
|
||||
darkSteelGliderDimensionBlocklist = config.get(
|
||||
sectionDarkSteel.name,
|
||||
"darkSteelGliderDimensionBlocklist",
|
||||
darkSteelGliderDimensionBlocklist,
|
||||
"List of numeric IDs of dimensions in which the 'Glider' upgrade will not work.").getIntList();
|
||||
|
||||
darkSteelSoundLocatorCost = config.get(
|
||||
sectionDarkSteel.name,
|
||||
@@ -3018,6 +3026,11 @@ public final class Config {
|
||||
farmHoes.add(hoe);
|
||||
}
|
||||
}
|
||||
|
||||
darkSteelGliderDimensionBlocklistHash.clear();
|
||||
for (int dimId : darkSteelGliderDimensionBlocklist) {
|
||||
darkSteelGliderDimensionBlocklistHash.add(dimId);
|
||||
}
|
||||
}
|
||||
|
||||
public static ItemStack getStackForString(String s) {
|
||||
|
||||
@@ -329,10 +329,13 @@ public class KeyTracker {
|
||||
|
||||
private void handleGlide() {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
if (glideKey.isPressed() && DarkSteelController.instance.isGliderUpgradeEquipped(player)
|
||||
&& (DarkSteelController.instance.isGlideActive(player)
|
||||
|| DarkSteelController.instance.canActivateGlide(player))) {
|
||||
toggleDarkSteelController(Type.GLIDE, "darksteel.upgrade.glider");
|
||||
if (glideKey.isPressed() && DarkSteelController.instance.isGliderUpgradeEquipped(player)) {
|
||||
if ((DarkSteelController.instance.isGlideActive(player)
|
||||
|| DarkSteelController.instance.canActivateGlide(player))) {
|
||||
toggleDarkSteelController(Type.GLIDE, "darksteel.upgrade.glider");
|
||||
} else if (!DarkSteelController.instance.isGlideAllowedInDimension(player)) {
|
||||
ChatUtil.sendNoSpamClientUnloc(EnderIO.lang, "darksteel.upgrade.glider.blocklisted");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovementInput;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -158,8 +159,12 @@ public class DarkSteelController {
|
||||
return isActive(player, Type.GLIDE);
|
||||
}
|
||||
|
||||
public boolean isGlideAllowedInDimension(EntityPlayer player) {
|
||||
return !Config.darkSteelGliderDimensionBlocklistHash.contains(player.dimension);
|
||||
}
|
||||
|
||||
public boolean canActivateGlide(EntityPlayer player) {
|
||||
return !EtFuturumCompat.isElytraFlying(player);
|
||||
return !EtFuturumCompat.isElytraFlying(player) && isGlideAllowedInDimension(player);
|
||||
}
|
||||
|
||||
public boolean isSpeedActive(EntityPlayer player) {
|
||||
@@ -198,6 +203,15 @@ public class DarkSteelController {
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onJoinDimension(EntityJoinWorldEvent event) {
|
||||
if (event.entity instanceof EntityPlayer player) {
|
||||
if (!isGlideAllowedInDimension(player)) {
|
||||
setActive(player, Type.GLIDE, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void updateSolar(EntityPlayer player) {
|
||||
// no processing on client
|
||||
if (player.worldObj.isRemote) {
|
||||
|
||||
@@ -877,6 +877,7 @@ enderio.darksteel.upgrade.glider.name=Gleiter
|
||||
enderio.darksteel.upgrade.glider.tooltip.detailed.line1=Ermöglicht Gleiten
|
||||
enderio.darksteel.upgrade.glider.enabled=Gleiter Aktiv
|
||||
enderio.darksteel.upgrade.glider.disabled=Gleiter Inaktiv
|
||||
enderio.darksteel.upgrade.glider.blocklisted=Der Gleiter scheint nicht in dieser Dimension zu funktionieren...
|
||||
|
||||
enderio.darksteel.upgrade.sound.name=Schalldetektor
|
||||
enderio.darksteel.upgrade.sound.tooltip.detailed.line1=Zeigt die Position von
|
||||
|
||||
@@ -975,6 +975,7 @@ enderio.darksteel.upgrade.glider.name=Glider
|
||||
enderio.darksteel.upgrade.glider.tooltip.detailed.line1=Enables gliding
|
||||
enderio.darksteel.upgrade.glider.enabled=Glider Active
|
||||
enderio.darksteel.upgrade.glider.disabled=Glider Disabled
|
||||
enderio.darksteel.upgrade.glider.blocklisted=The Glider does not seem to work in this dimension...
|
||||
|
||||
enderio.darksteel.upgrade.sound.name=Sound Locator
|
||||
enderio.darksteel.upgrade.sound.tooltip.detailed.line1=Displays the location of
|
||||
|
||||
Reference in new issue
Block a user