Update dependencies, added Albedo support

This commit is contained in:
raoulvdberge
2017-07-27 23:14:33 +02:00
parent 1f68f9bc3d
commit 51527d6af3
3 changed files with 44 additions and 8 deletions

View File

@@ -1,6 +1,8 @@
# Refined Storage Changelog
### 1.5.14
- Updated Forge to 2426 (raoulvdberge)
- Added Albedo support (raoulvdberge)
- Fixed more crashes relating to scrollbar in GUIs (raoulvdberge)
- Fixed crash with Detector (raoulvdberge)
- Fixed bug where pattern create button wasn't visible when grid tabs were selected (raoulvdberge)

View File

@@ -28,10 +28,10 @@ sourceCompatibility = 1.8
targetCompatibility = 1.8
minecraft {
version = "1.12-14.21.1.2400"
version = "1.12-14.21.1.2426"
runDir = "run"
useDepAts = true
mappings = "snapshot_20170707"
mappings = "snapshot_20170727"
}
repositories {
@@ -47,16 +47,18 @@ repositories {
maven {
url "https://dl.bintray.com/jaquadro/dev"
}
maven {
url 'https://repo.elytradev.com/'
}
}
dependencies {
deobfCompile "mezz.jei:jei_1.12:4.7.1.71:api"
runtime "mezz.jei:jei_1.12:4.7.1.71"
deobfCompile "mezz.jei:jei_1.12:4.7.2.77:api"
runtime "mezz.jei:jei_1.12:4.7.2.77"
deobfCompile "MCMultiPart2:MCMultiPart:2.2.2"
// deobfCompile "li.cil.oc:OpenComputers:MC1.11.2-1.7.0.28:api"
deobfCompile "com.jaquadro.minecraft.storagedrawers:StorageDrawers:1.12-5.2.2:api"
// runtime "com.jaquadro.minecraft.storagedrawers:StorageDrawers:1.12-5.2.2"
// runtime "com.jaquadro.minecraft.chameleon:Chameleon:1.12-4.1.0"
deobfCompile "com.jaquadro.minecraft.storagedrawers:StorageDrawers:1.12-5.2.9:api"
deobfCompile "elucent:albedo:2.0-SNAPSHOT"
}
processResources {

View File

@@ -45,6 +45,8 @@ import com.raoulvdberge.refinedstorage.tile.data.RSSerializers;
import com.raoulvdberge.refinedstorage.tile.data.TileDataParameter;
import com.raoulvdberge.refinedstorage.util.StackUtils;
import com.raoulvdberge.refinedstorage.util.WorldUtils;
import elucent.albedo.lighting.ILightProvider;
import elucent.albedo.lighting.Light;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
@@ -61,6 +63,7 @@ import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.energy.CapabilityEnergy;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.common.Optional;
import net.minecraftforge.items.ItemHandlerHelper;
import javax.annotation.Nonnull;
@@ -68,7 +71,8 @@ import javax.annotation.Nullable;
import java.util.*;
import java.util.function.Predicate;
public class TileController extends TileBase implements ITickable, INetwork, IRedstoneConfigurable, INetworkNode, INetworkNodeProxy<TileController> {
@Optional.Interface(iface = "elucent.albedo.lighting.ILightProvider", modid = "albedo")
public class TileController extends TileBase implements ITickable, INetwork, IRedstoneConfigurable, INetworkNode, INetworkNodeProxy<TileController>, ILightProvider {
private static final Comparator<ClientNode> CLIENT_NODE_COMPARATOR = (left, right) -> {
if (left.getEnergyUsage() == right.getEnergyUsage()) {
return 0;
@@ -745,4 +749,32 @@ public class TileController extends TileBase implements ITickable, INetwork, IRe
public TileController getNode() {
return this;
}
@Optional.Method(modid = "albedo")
@Override
public Light provideLight() {
int energy = getEnergyScaledForDisplay();
if (energy == 0) {
return null;
}
float r, g, b;
if (energy >= 3) {
r = 16F;
g = 152F;
b = 255F;
} else {
r = 194F;
g = 59F;
b = 81F;
}
return Light.builder()
.pos(pos)
.color(r / 255F, g / 255F, b / 255F)
.radius(4)
.build();
}
}