Skip to content

Commit

Permalink
Merge branch 'legacy/1.12.2' into legacy/1.8.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Grayray75 committed Aug 23, 2023
2 parents a1b8df7 + 8cfdf3d commit b98dc57
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 16 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ Phosphor-Legacy is port of JellySquid's Phosphor mod to Legacy-Fabric.

Currently this just the original 1.12.2 code changed in order to work with fabric.

I do plan on backporting this mod to 1.8.9 if thats even possible.

## 📥 Downloads

You can download this mod from:
Expand All @@ -14,10 +12,10 @@ You can download this mod from:

## 🎲 Supported versions

| Minecraft: | Support: |
| ---------- | -------- |
| 1.12.2 | ✔️ Active |
| 1.8.9 | Panned |
| Minecraft: | Support: |
| ---------- | --------------- |
| 1.12.2 | ✔️ Active |
| 1.8.9 | ✔️ Active (BETA) |


# Phosphor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.jellysquid.mods.phosphor.mixins;
package me.jellysquid.mods.phosphor.mixins.common;

import net.minecraft.util.math.Direction;
import org.spongepowered.asm.mixin.Mixin;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.jellysquid.mods.phosphor.mod.world.lighting;
package me.jellysquid.mods.phosphor.mod.world;

import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
Expand All @@ -7,7 +7,7 @@
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.ChunkSection;

public class LightingEngineHelpers {
public class BlockStateHelper {
private static final BlockState DEFAULT_BLOCK_STATE = Blocks.AIR.getDefaultState();

// Avoids some additional logic in Chunk#getBlockState... 0 is always air
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

import me.jellysquid.mods.phosphor.api.IChunkLighting;
import me.jellysquid.mods.phosphor.api.ILightingEngine;
import me.jellysquid.mods.phosphor.mixins.DirectionAccessor;
import me.jellysquid.mods.phosphor.mixins.common.DirectionAccessor;
import me.jellysquid.mods.phosphor.mod.PhosphorMod;
import me.jellysquid.mods.phosphor.mod.collections.PooledLongQueue;
import me.jellysquid.mods.phosphor.mod.world.BlockStateHelper;
import me.jellysquid.mods.phosphor.mod.world.ChunkHelper;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
Expand Down Expand Up @@ -300,7 +301,7 @@ else if (oldLight > newLight) {
continue;
}

final BlockState state = LightingEngineHelpers.posToState(this.curPos, this.curChunk);
final BlockState state = BlockStateHelper.posToState(this.curPos, this.curChunk);
final int luminosity = this.getCursorLuminosity(state, lightType);
final int opacity; //if luminosity is high enough, opacity is irrelevant

Expand Down Expand Up @@ -333,7 +334,7 @@ else if (oldLight > newLight) {

final BlockPos.Mutable nPos = info.pos;

if (curLight - this.getPosOpacity(nPos, LightingEngineHelpers.posToState(nPos, info.section)) >= nLight) //schedule neighbor for darkening if we possibly light it
if (curLight - this.getPosOpacity(nPos, BlockStateHelper.posToState(nPos, info.section)) >= nLight) //schedule neighbor for darkening if we possibly light it
{
this.enqueueDarkening(nPos, info.key, nLight, nChunk, lightType);
}
Expand Down Expand Up @@ -454,7 +455,7 @@ else if (lightType == LightType.SKY) {


private int calculateNewLightFromCursor(final LightType lightType) {
final BlockState state = LightingEngineHelpers.posToState(this.curPos, this.curChunk);
final BlockState state = BlockStateHelper.posToState(this.curPos, this.curChunk);

final int luminosity = this.getCursorLuminosity(state, lightType);
final int opacity;
Expand Down Expand Up @@ -501,7 +502,7 @@ private void spreadLightFromCursor(final int curLight, final LightType lightType
continue;
}

final int newLight = curLight - this.getPosOpacity(info.pos, LightingEngineHelpers.posToState(info.pos, info.section));
final int newLight = curLight - this.getPosOpacity(info.pos, BlockStateHelper.posToState(info.pos, info.section));

if (newLight > info.light) {
this.enqueueBrightening(info.pos, info.key, newLight, nChunk, lightType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import me.jellysquid.mods.phosphor.api.IChunkLightingData;
import me.jellysquid.mods.phosphor.api.ILightingEngine;
import me.jellysquid.mods.phosphor.api.ILightingEngineProvider;
import me.jellysquid.mods.phosphor.mixins.DirectionAccessor;
import me.jellysquid.mods.phosphor.mixins.common.DirectionAccessor;
import me.jellysquid.mods.phosphor.mod.PhosphorMod;
import me.jellysquid.mods.phosphor.mod.world.ChunkHelper;
import net.minecraft.block.Block;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/phosphor.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"package": "me.jellysquid.mods.phosphor.mixins",
"compatibilityLevel": "JAVA_8",
"mixins": [
"DirectionAccessor",
"common.ChunkDataS2CPacketMixin",
"common.ChunkMixin",
"common.ChunkMixin$Vanilla",
"common.ChunkSectionMixin",
"common.DirectionAccessor",
"common.ServerChunkProviderAccessor",
"common.ServerChunkProviderMixin",
"common.ThreadedAnvilChunkStorageMixin",
Expand Down

0 comments on commit b98dc57

Please sign in to comment.