Compare commits

..
2 Commits
Author SHA1 Message Date
Martin Robertz 19f19d348b update bs+deps 2024-01-24 18:19:30 +01:00
Under 3154d03b4f Fix Anchor always rendering bug (#148)
* Fix Anchor always rendering bug

Also stop inventory scanning from happening every client tick, whoops.
Tested by placing a debug point on line 768 of TravelController (in getRequiredPower) and a debug point at line 656 of TravelController (in findTravelItemInInventoryOrBaubles). Debug points were used to verify that the code was ONLY hit when actual teleport happens, and not happening every tick like what was accidentally happening before.

* Run spotlessApply

Forgot that was a thing I do for GTNH stuff.
2024-01-24 10:58:27 -06:00
5 changed files with 44 additions and 23 deletions

No files matched your search

+23 -4
View File
@@ -1,4 +1,4 @@
//version: 1704751096
//version: 1705357285
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
@@ -122,6 +122,7 @@ propertyDefaultIfUnset("modrinthProjectId", "")
propertyDefaultIfUnset("modrinthRelations", "")
propertyDefaultIfUnset("curseForgeProjectId", "")
propertyDefaultIfUnset("curseForgeRelations", "")
propertyDefaultIfUnset("versionPattern", "")
propertyDefaultIfUnset("minimizeShadowedDependencies", true)
propertyDefaultIfUnset("relocateShadowedDependencies", true)
// Deprecated properties (kept for backwards compat)
@@ -370,6 +371,7 @@ catch (Exception ignored) {
// Pulls version first from the VERSION env and then git tag
String identifiedVersion
String versionOverride = System.getenv("VERSION") ?: null
boolean checkVersion = false
try {
// Produce a version based on the tag, or for branches something like 0.2.2-configurable-maven-and-extras.38+43090270b6-dirty
if (versionOverride == null) {
@@ -388,6 +390,8 @@ try {
}
} else if (isDirty) {
identifiedVersion += "-${branchName}+${gitDetails.gitHash}-dirty"
} else {
checkVersion = true
}
} else {
identifiedVersion = versionOverride
@@ -409,6 +413,8 @@ ext {
if (identifiedVersion == versionOverride) {
out.style(Style.Failure).text('Override version to ').style(Style.Identifier).text(modVersion).style(Style.Failure).println('!\7')
} else if (checkVersion && versionPattern && !(identifiedVersion ==~ versionPattern)) {
throw new GradleException("Invalid version: '$identifiedVersion' does not match version pattern '$versionPattern'")
}
group = "com.github.GTNewHorizons"
@@ -428,18 +434,31 @@ minecraft {
for (f in replaceGradleTokenInFile.split(',')) {
tagReplacementFiles.add f
}
out.style(Style.Info).text('replaceGradleTokenInFile is deprecated! Consider using generateGradleTokenClass.').println()
}
if (gradleTokenModId) {
injectedTags.put gradleTokenModId, modId
if (replaceGradleTokenInFile) {
injectedTags.put gradleTokenModId, modId
} else {
out.style(Style.Failure).text('gradleTokenModId is deprecated! The field will no longer be generated.').println()
}
}
if (gradleTokenModName) {
injectedTags.put gradleTokenModName, modName
if (replaceGradleTokenInFile) {
injectedTags.put gradleTokenModName, modName
} else {
out.style(Style.Failure).text('gradleTokenModName is deprecated! The field will no longer be generated.').println()
}
}
if (gradleTokenVersion) {
injectedTags.put gradleTokenVersion, modVersion
}
if (gradleTokenGroupName) {
injectedTags.put gradleTokenGroupName, modGroup
if (replaceGradleTokenInFile) {
injectedTags.put gradleTokenGroupName, modGroup
} else {
out.style(Style.Failure).text('gradleTokenGroupName is deprecated! The field will no longer be generated.').println()
}
}
if (enableGenericInjection.toBoolean()) {
injectMissingGenerics.set(true)
+8 -8
View File
@@ -1,21 +1,21 @@
// Add your dependencies here
dependencies {
api('com.github.GTNewHorizons:EnderCore:0.3.0:dev') {transitive = false}
api('com.github.GTNewHorizons:EnderCore:0.3.1:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:ForestryMC:4.8.2:dev')
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.5.4-GTNH:dev')
compileOnly("com.github.GTNewHorizons:GTNHLib:0.1.0:dev")
compileOnly("com.github.GTNewHorizons:GTNHLib:0.2.1:dev")
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.39:dev')
api('curse.maven:cofh-lib-220333:2388748') // https://www.curseforge.com/minecraft/mc-mods/cofh-lib/files/2388748
shadowImplementation('cglib:cglib-nodep:3.3.0')
compileOnly('com.github.GTNewHorizons:waila:1.6.5:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-310-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Baubles:1.0.3:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.25:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:Railcraft:9.15.3:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:waila:1.7.0:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-312-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Baubles:1.0.4:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.45.45:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:Railcraft:9.15.5:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:StorageDrawers:1.13.0-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Chisel:2.13.2-GTNH:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:Chisel:2.13.4-GTNH:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:OpenComputers:1.10.6-GTNH:api') {transitive = false}
compileOnly('curse.maven:minefactory-reloaded-66672:2366150') // https://www.curseforge.com/minecraft/mc-mods/minefactory-reloaded/files/2366150
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
@@ -81,7 +81,7 @@ public enum TravelSource {
return 0;
}
TravelSource source = TravelController.instance.getTravelItemTravelSource(player);
TravelSource source = TravelController.instance.getTravelItemTravelSource(player, false);
if (source == null) {
return TravelSource.BLOCK.getMaxDistanceTravelledSq();
} else {
@@ -527,7 +527,7 @@ public class TravelController {
}
onBlockCoord = getActiveTravelBlock(player);
boolean onBlock = onBlockCoord != null;
showTargets = onBlock || isTravelItemActive(player);
showTargets = onBlock || isTravelItemActive(player, false);
if (showTargets) {
updateSelectedTarget(player);
} else {
@@ -615,22 +615,23 @@ public class TravelController {
return ((IItemOfTravel) equipped.getItem()).getEnergyStored(equipped);
}
public boolean isTravelItemActive(EntityPlayer ep) {
return getTravelItemTravelSource(ep) != null;
public boolean isTravelItemActive(EntityPlayer ep, boolean checkInventoryAndBaubles) {
return getTravelItemTravelSource(ep, checkInventoryAndBaubles) != null;
}
/** Returns null if no travel item is in inventory/baubles. */
@Nullable
public TravelSource getTravelItemTravelSource(EntityPlayer ep) {
public TravelSource getTravelItemTravelSource(EntityPlayer ep, boolean checkInventoryAndBaubles) {
if (ep == null) {
return null;
}
ItemStack equipped = ep.getCurrentEquippedItem();
if (equipped == null || !(equipped.getItem() instanceof IItemOfTravel)) {
equipped = findTravelItemInInventoryOrBaubles(ep);
if (checkInventoryAndBaubles) {
if (equipped == null || !(equipped.getItem() instanceof IItemOfTravel)) {
equipped = findTravelItemInInventoryOrBaubles(ep);
}
}
if (equipped != null) {
if (equipped.getItem() instanceof ItemTeleportStaff) {
if (((ItemTeleportStaff) equipped.getItem()).isActive(ep, equipped)) {
@@ -764,7 +765,7 @@ public class TravelController {
}
public int getRequiredPower(EntityPlayer player, TravelSource source, BlockCoord coord) {
if (!isTravelItemActive(player)) {
if (!isTravelItemActive(player, true)) {
return 0;
}
int requiredPower;
@@ -1063,7 +1064,7 @@ public class TravelController {
@SideOnly(Side.CLIENT)
private int getMaxTravelDistanceSqForPlayer(EntityPlayer player) {
TravelSource source = getTravelItemTravelSource(player);
TravelSource source = getTravelItemTravelSource(player, false);
if (source == null) {
return TravelSource.BLOCK.getMaxDistanceTravelledSq();
}
@@ -69,7 +69,8 @@ public class TravelEntitySpecialRenderer extends TileEntitySpecialRenderer {
Vector3d eye = Util.getEyePositionEio(Minecraft.getMinecraft().thePlayer);
Vector3d loc = new Vector3d(tileentity.xCoord + 0.5, tileentity.yCoord + 0.5, tileentity.zCoord + 0.5);
double maxDistance = TravelSource.BLOCK.getMaxDistanceTravelledSq();
TravelSource source = TravelController.instance.getTravelItemTravelSource(Minecraft.getMinecraft().thePlayer);
TravelSource source = TravelController.instance
.getTravelItemTravelSource(Minecraft.getMinecraft().thePlayer, false);
if (source != null) {
maxDistance = source.getMaxDistanceTravelledSq();
}