Skip to content

Commit

Permalink
try fix compatible with include LDL mods
Browse files Browse the repository at this point in the history
  • Loading branch information
TexBlock committed Nov 4, 2023
1 parent 9dffa19 commit aa84220
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
## Changelog
- Removed `Architectury API` dependencies
- try fix compatible with include LDL mods
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ yarn_mappings=1.18.2+build.4
forge_version=1.18.2-40.2.10

# Mod Properties
mod_version = 0.1.3
mod_version = 0.1.4
maven_group = dev.lambdaurora
archives_base_name = Ryoamiclights
modrinth_id=reCfnRvJ
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public interface DynamicLightSource {
*
* @return {@code true} if the dynamic light is enabled, else {@code false}
*/
default boolean isDynamicLightEnabled() {
default boolean ryoamicLights$isDynamicLightEnabled() {
return LambDynLights.get().config.getDynamicLightsMode().isEnabled() && LambDynLights.get().containsLightSource(this);
}

Expand All @@ -67,7 +67,7 @@ default boolean isDynamicLightEnabled() {
* @param enabled {@code true} if the dynamic light is enabled, else {@code false}
*/
@ApiStatus.Internal
default void setDynamicLightEnabled(boolean enabled) {
default void ryoamicLights$setDynamicLightEnabled(boolean enabled) {
this.ryoamicLights$resetDynamicLight();
if (enabled)
LambDynLights.get().addLightSource(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,13 +433,13 @@ public static void updateTrackedChunks(@NotNull BlockPos chunkPos, @Nullable Lon
* @param lightSource the light source
*/
public static void updateTracking(@NotNull DynamicLightSource lightSource) {
boolean enabled = lightSource.isDynamicLightEnabled();
boolean enabled = lightSource.ryoamicLights$isDynamicLightEnabled();
int luminance = lightSource.ryoamicLights$getLuminance();

if (!enabled && luminance > 0) {
lightSource.setDynamicLightEnabled(true);
lightSource.ryoamicLights$setDynamicLightEnabled(true);
} else if (enabled && luminance < 1) {
lightSource.setDynamicLightEnabled(false);
lightSource.ryoamicLights$setDynamicLightEnabled(false);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private void onFinishRemovingEntity(int entityId, Entity.RemovalReason removalRe
var entity = this.getEntityLookup().get(entityId);
if (entity != null) {
var dls = (DynamicLightSource) entity;
dls.setDynamicLightEnabled(false);
dls.ryoamicLights$setDynamicLightEnabled(false);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private void onTick(CallbackInfo ci) {
// We do not want to update the entity on the server.
if (this.getEntityWorld().isClient()) {
if (this.isRemoved()) {
this.setDynamicLightEnabled(false);
this.ryoamicLights$setDynamicLightEnabled(false);
} else {
if (!LambDynLights.get().config.getEntitiesLightSource().get() || !DynamicLightHandlers.canLightUp(this))
this.ryoamicLights$resetDynamicLight();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private void onTick(CallbackInfo ci) {
// We do not want to update the entity on the server.
if (this.world.isClient()) {
if (this.isRemoved()) {
this.setDynamicLightEnabled(false);
this.ryoamicLights$setDynamicLightEnabled(false);
} else {
if (!LambDynLights.get().config.getEntitiesLightSource().get() || !DynamicLightHandlers.canLightUp(this))
this.lambdynlights$luminance = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public abstract class BlockEntityMixin implements DynamicLightSource {

@Inject(method = "markRemoved", at = @At("TAIL"))
private void onRemoved(CallbackInfo ci) {
this.setDynamicLightEnabled(false);
this.ryoamicLights$setDynamicLightEnabled(false);
}

@Override
Expand All @@ -91,7 +91,7 @@ private void onRemoved(CallbackInfo ci) {
this.ryoamicLights$luminance = DynamicLightHandlers.getLuminanceFrom((BlockEntity) (Object) this);
LambDynLights.updateTracking(this);

if (!this.isDynamicLightEnabled()) {
if (!this.ryoamicLights$isDynamicLightEnabled()) {
this.ryoamicLights$lastLuminance = 0;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void onTick(CallbackInfo ci) {
// We do not want to update the entity on the server.
if (this.world.isClient()) {
if (this.isRemoved()) {
this.setDynamicLightEnabled(false);
this.ryoamicLights$setDynamicLightEnabled(false);
} else {
this.ryoamicLights$dynamicLightTick();
if ((!LambDynLights.get().config.getEntitiesLightSource().get() && this.getType() != EntityType.PLAYER)
Expand All @@ -93,7 +93,7 @@ public void onTick(CallbackInfo ci) {
@Inject(method = "remove", at = @At("TAIL"))
public void onRemove(CallbackInfo ci) {
if (this.world.isClient())
this.setDynamicLightEnabled(false);
this.ryoamicLights$setDynamicLightEnabled(false);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public ExplosiveProjectileEntityMixin(EntityType<?> type, World world) {

@Override
public void ryoamicLights$dynamicLightTick() {
if (!this.isDynamicLightEnabled())
this.setDynamicLightEnabled(true);
if (!this.ryoamicLights$isDynamicLightEnabled())
this.ryoamicLights$setDynamicLightEnabled(true);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private void onTick(CallbackInfo ci) {
return;

if (this.isRemoved()) {
this.setDynamicLightEnabled(false);
this.ryoamicLights$setDynamicLightEnabled(false);
} else {
if (!LambDynLights.get().config.getEntitiesLightSource().get() || !DynamicLightHandlers.canLightUp(this))
this.ryoamicLights$resetDynamicLight();
Expand Down

0 comments on commit aa84220

Please sign in to comment.