0.1.3
EnergonRelics/pipeline/head This commit looks good Details

This commit is contained in:
TheBrokenRail 2020-08-19 20:40:49 -04:00
parent 4799ad5903
commit 8241f88fea
6 changed files with 36 additions and 8 deletions

View File

@ -1,5 +1,11 @@
# Changelog
**Beta 0.1.3**
* Optimizations
* Fix Energy Teleporter Y Issues
* Make Industrial Laser Set Fire To Entities
* Redolence Solar Panels
**Beta 0.1.2**
* Improve Highlight Rendering

View File

@ -10,7 +10,7 @@ org.gradle.jvmargs = -Xmx1G
fabric_loader_version = 0.9.0+build.204
# Mod Properties
mod_version = 0.1.2
mod_version = 0.1.3
maven_group = com.thebrokenrail
# Dependencies

View File

@ -5,6 +5,7 @@ import com.thebrokenrail.energonrelics.config.HardcodedConfig;
import com.thebrokenrail.energonrelics.api.energy.tick.EnergyTickable;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.LightType;
import java.util.List;
@ -25,7 +26,7 @@ public class SolarPanelBlockEntity extends EnergyGeneratorBlockEntity {
for (Direction side : Direction.values()) {
light = Math.max(light, getLight(side));
}
return light;
return (int) (((float) light) * MathHelper.cos(Objects.requireNonNull(getWorld()).getSkyAngleRadians(1f)));
}
@Override

View File

@ -5,6 +5,7 @@ import com.thebrokenrail.energonrelics.block.entity.forcefield.FieldProjectorBlo
import com.thebrokenrail.energonrelics.block.forcefield.laser.IndustrialLaserProjectorBlock;
import com.thebrokenrail.energonrelics.config.HardcodedConfig;
import com.thebrokenrail.energonrelics.potion.CustomPotions;
import com.thebrokenrail.energonrelics.registry.laser.IndustrialLaserRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;

View File

@ -14,12 +14,12 @@ public final class HardcodedConfig {
public static final int ENERGON_LIGHT_ENERGY_REQUIRED = 5;
public static final long SOLAR_PANEL_MAX_ENERGY_OUTPUT = 50;
public static final long SOLAR_PANEL_MAX_ENERGY_OUTPUT = 70;
public static final long BATTERY_CHARGE_RATE = 40;
public static final int REACTOR_TIME = 2400;
public static final int REACTOR_ENERGY_OUTPUT = 250;
public static final int REACTOR_ENERGY_OUTPUT = 350;
public static final int DEFENSIVE_LASER_RANGE = 28;
public static final long DEFENSIVE_LASER_IDLE_ENERGY_REQUIRED = 32;

View File

@ -1,4 +1,4 @@
package com.thebrokenrail.energonrelics.block.entity.forcefield.laser;
package com.thebrokenrail.energonrelics.registry.laser;
import com.thebrokenrail.energonrelics.EnergonRelics;
import com.thebrokenrail.energonrelics.config.HardcodedConfig;
@ -13,10 +13,19 @@ import java.util.Map;
import java.util.Random;
import java.util.function.Function;
/**
* Industrial Laser Registry
*/
public class IndustrialLaserRegistry {
private static final Map<Block, Function<Random, ItemStack>> map = new HashMap<>();
private static void add(Block ore, Item ingot, Block storage) {
/**
* Add To Registry
* @param ore Ore Block
* @param ingot Ingot Item
* @param storage Storage Block
*/
public static void add(Block ore, Item ingot, Block storage) {
map.put(ore, random -> {
int min = HardcodedConfig.INDUSTRIAL_LASER_MIN_INGOTS_FROM_ORE;
int max = HardcodedConfig.INDUSTRIAL_LASER_MAX_INGOTS_FROM_ORE;
@ -28,11 +37,22 @@ public class IndustrialLaserRegistry {
map.put(storage, random -> new ItemStack(ingot, HardcodedConfig.INDUSTRIAL_LASER_INGOTS_FROM_STORAGE));
}
static boolean has(Block block) {
/**
* Check If Registry Contains Block
* @param block Block
* @return If Registry Contains Block
*/
public static boolean has(Block block) {
return map.containsKey(block);
}
static ItemStack get(Block block, Random random) {
/**
* Get From Registry
* @param block Block
* @param random Random
* @return Output Item(s)
*/
public static ItemStack get(Block block, Random random) {
return map.get(block).apply(random);
}