20w29a
All checks were successful
EnergonRelics/pipeline/head This commit looks good

Add Thermal Glass
Improve Recipes
Tweak Defensive Laser
This commit is contained in:
TheBrokenRail 2020-07-16 23:55:31 -04:00
parent a6dc65027d
commit ef5ba52ef9
23 changed files with 134 additions and 22 deletions

View File

@ -3,9 +3,9 @@ org.gradle.jvmargs = -Xmx1G
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/use # check these on https://fabricmc.net/use
minecraft_version = 20w28a minecraft_version = 20w29a
yarn_build = 20 yarn_build = 8
fabric_loader_version = 0.8.9+build.203 fabric_loader_version = 0.9.0+build.204
# Mod Properties # Mod Properties
mod_version = 1.0.0 mod_version = 1.0.0
@ -13,4 +13,4 @@ org.gradle.jvmargs = -Xmx1G
# Dependencies # Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_api_version = 0.14.5+build.376-1.16 fabric_api_version = 0.14.6+build.377-1.16

View File

@ -13,6 +13,6 @@ public class Config {
public static final int REACTOR_ENERGY_OUTPUT = 250; public static final int REACTOR_ENERGY_OUTPUT = 250;
public static final int DEFENSIVE_LASER_RANGE = 18; public static final int DEFENSIVE_LASER_RANGE = 18;
public static final int DEFENSIVE_LASER_IDLE_ENERGY_REQUIRED = 25; public static final int DEFENSIVE_LASER_IDLE_ENERGY_REQUIRED = 32;
public static final int DEFENSIVE_LASER_FIRE_ENERGY_REQUIRED = 64; public static final int DEFENSIVE_LASER_FIRE_ENERGY_REQUIRED = 64;
} }

View File

@ -1,6 +1,7 @@
package com.thebrokenrail.energonrelics; package com.thebrokenrail.energonrelics;
import com.thebrokenrail.energonrelics.block.DefensiveLaserBlock; import com.thebrokenrail.energonrelics.block.DefensiveLaserBlock;
import com.thebrokenrail.energonrelics.block.ThermalGlassBlock;
import com.thebrokenrail.energonrelics.block.battery.ActiveBatteryControllerBlock; import com.thebrokenrail.energonrelics.block.battery.ActiveBatteryControllerBlock;
import com.thebrokenrail.energonrelics.block.reactor.ReactorControllerBlock; import com.thebrokenrail.energonrelics.block.reactor.ReactorControllerBlock;
import com.thebrokenrail.energonrelics.block.reactor.ReactorCoreBlock; import com.thebrokenrail.energonrelics.block.reactor.ReactorCoreBlock;
@ -43,6 +44,7 @@ public class EnergonRelics implements ModInitializer {
public static final MultimeterItem MULTIMETER_ITEM = new MultimeterItem(); public static final MultimeterItem MULTIMETER_ITEM = new MultimeterItem();
public static final ThermalCasingBlock THERMAL_CASING_BLOCK = new ThermalCasingBlock(); public static final ThermalCasingBlock THERMAL_CASING_BLOCK = new ThermalCasingBlock();
public static final ThermalGlassBlock THERMAL_GLASS_BLOCK = new ThermalGlassBlock();
public static final BatteryCoreBlock BATTERY_CORE_BLOCk = new BatteryCoreBlock(); public static final BatteryCoreBlock BATTERY_CORE_BLOCk = new BatteryCoreBlock();
public static final PassiveBatteryControllerBlock PASSIVE_BATTERY_CONTROLLER_BLOCk = new PassiveBatteryControllerBlock(); public static final PassiveBatteryControllerBlock PASSIVE_BATTERY_CONTROLLER_BLOCk = new PassiveBatteryControllerBlock();
@ -55,11 +57,11 @@ public class EnergonRelics implements ModInitializer {
public static final Item VERIDIUM_INGOT_ITEM = new Item(new Item.Settings().group(ITEM_GROUP)); public static final Item VERIDIUM_INGOT_ITEM = new Item(new Item.Settings().group(ITEM_GROUP));
public static final SimpleBlock VERIDIUM_ORE_BLOCK = new SimpleBlock(FabricBlockSettings.of(Material.STONE).requiresTool().strength(3.0F, 3.0F)); public static final SimpleBlock VERIDIUM_ORE_BLOCK = new SimpleBlock(FabricBlockSettings.of(Material.STONE).requiresTool().strength(3.0F, 3.0F));
public static final SimpleBlock VERIDIUM_BLOCK_BLOCK = new SimpleBlock(FabricBlockSettings.of(Material.METAL, MaterialColor.GOLD).requiresTool().strength(3.0F, 6.0F).sounds(BlockSoundGroup.METAL)); public static final SimpleBlock VERIDIUM_BLOCK_BLOCK = new SimpleBlock(FabricBlockSettings.of(Material.METAL, MaterialColor.GOLD).requiresTool().strength(3.0F, 6.0F).sounds(BlockSoundGroup.METAL));
public static final ConfiguredFeature<?, ?> VERIDIUM_ORE_FEATURE = Feature.ORE.configure(new OreFeatureConfig(OreFeatureConfig.class_5436.field_25845, EnergonRelics.VERIDIUM_ORE_BLOCK.getDefaultState(), 9)).method_30377(32).method_30371().method_30375(2); public static final ConfiguredFeature<?, ?> VERIDIUM_ORE_FEATURE = Feature.ORE.configure(new OreFeatureConfig(OreFeatureConfig.class_5436.field_25845, EnergonRelics.VERIDIUM_ORE_BLOCK.getDefaultState(), 9)).method_30377(32).spreadHorizontally().repeat(2);
public static final Item CIRCUIT_BOARD_ITEM = new Item(new Item.Settings().group(ITEM_GROUP)); public static final Item CIRCUIT_BOARD_ITEM = new Item(new Item.Settings().group(ITEM_GROUP));
public static final Item DEFENSIVE_LASER_CORE_ITEM = new Item(new Item.Settings().group(ITEM_GROUP));; public static final Item DEFENSIVE_LASER_CORE_ITEM = new Item(new Item.Settings().group(ITEM_GROUP));
public static final DefensiveLaserBlock DEFENSIVE_LASER_BLOCK = new DefensiveLaserBlock(); public static final DefensiveLaserBlock DEFENSIVE_LASER_BLOCK = new DefensiveLaserBlock();
@Override @Override
@ -73,6 +75,7 @@ public class EnergonRelics implements ModInitializer {
SWITCH_BLOCk.register("switch"); SWITCH_BLOCk.register("switch");
THERMAL_CASING_BLOCK.register("thermal_casing"); THERMAL_CASING_BLOCK.register("thermal_casing");
THERMAL_GLASS_BLOCK.register("thermal_glass");
BATTERY_CORE_BLOCk.register("battery_core"); BATTERY_CORE_BLOCk.register("battery_core");
PASSIVE_BATTERY_CONTROLLER_BLOCk.register("passive_battery_controller"); PASSIVE_BATTERY_CONTROLLER_BLOCk.register("passive_battery_controller");

View File

@ -2,7 +2,7 @@ package com.thebrokenrail.energonrelics.block;
import com.thebrokenrail.energonrelics.block.entity.DefensiveLaserBlockEntity; import com.thebrokenrail.energonrelics.block.entity.DefensiveLaserBlockEntity;
import com.thebrokenrail.energonrelics.block.util.EnergyProviderBlock; import com.thebrokenrail.energonrelics.block.util.EnergyProviderBlock;
import com.thebrokenrail.energonrelics.client.render.DefensiveLaserBlockEntityRenderer; import com.thebrokenrail.energonrelics.client.block.entity.render.DefensiveLaserBlockEntityRenderer;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
@ -26,7 +26,7 @@ public class DefensiveLaserBlock extends EnergyProviderBlock {
public static final BooleanProperty POWERED = Properties.POWERED; public static final BooleanProperty POWERED = Properties.POWERED;
public DefensiveLaserBlock() { public DefensiveLaserBlock() {
super(FabricBlockSettings.of(Material.GLASS, MaterialColor.BLACK).requiresTool().strength(50.0F, 1200.0F).nonOpaque().allowsSpawning((state, world, pos, type) -> false).solidBlock((state, world, pos) -> false).suffocates((state, world, pos) -> false)); super(FabricBlockSettings.of(Material.GLASS, MaterialColor.BLACK).requiresTool().strength(50.0F, 1200.0F));
setDefaultState(getDefaultState().with(POWERED, false)); setDefaultState(getDefaultState().with(POWERED, false));
} }

View File

@ -0,0 +1,28 @@
package com.thebrokenrail.energonrelics.block;
import com.thebrokenrail.energonrelics.block.util.SimpleBlock;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.BlockState;
import net.minecraft.block.Material;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.BlockView;
public class ThermalGlassBlock extends SimpleBlock {
public ThermalGlassBlock() {
super(FabricBlockSettings.of(Material.STONE).requiresTool().strength(1.5f, 6.0f).nonOpaque().allowsSpawning((state, world, pos, type) -> false).solidBlock((state, world, pos) -> false).suffocates((state, world, pos) -> false));
}
@Override
@SuppressWarnings("deprecation")
@Environment(EnvType.CLIENT)
public float getAmbientOcclusionLightLevel(BlockState state, BlockView world, BlockPos pos) {
return 1.0F;
}
@Override
public boolean isTranslucent(BlockState state, BlockView world, BlockPos pos) {
return true;
}
}

View File

@ -174,7 +174,7 @@ public class DefensiveLaserBlockEntity extends EnergyReceiverBlockEntity {
} }
private List<LivingEntity> getEntities(Predicate<LivingEntity> predicate) { private List<LivingEntity> getEntities(Predicate<LivingEntity> predicate) {
return Objects.requireNonNull(getWorld()).getEntities(LivingEntity.class, new Box(getPos()).expand(Config.DEFENSIVE_LASER_RANGE), predicate); return Objects.requireNonNull(getWorld()).getEntitiesByClass(LivingEntity.class, new Box(getPos()).expand(Config.DEFENSIVE_LASER_RANGE), predicate);
} }
private Entity getDummyEntity() { private Entity getDummyEntity() {
@ -206,7 +206,7 @@ public class DefensiveLaserBlockEntity extends EnergyReceiverBlockEntity {
double distance; double distance;
if (collision != null) { if (collision != null) {
world.createExplosion(null, collision.getX(), collision.getY(), collision.getZ(), 3, Explosion.DestructionType.NONE); world.createExplosion(null, collision.getX(), collision.getY(), collision.getZ(), 1, Explosion.DestructionType.NONE);
distance = posVec.distanceTo(collision); distance = posVec.distanceTo(collision);
} else { } else {
@ -217,7 +217,7 @@ public class DefensiveLaserBlockEntity extends EnergyReceiverBlockEntity {
distance = distance * multiplier; distance = distance * multiplier;
for (int i = 0; i < distance; i++) { for (int i = 0; i < distance; i++) {
Vec3d vec = rotationVec.multiply(i / multiplier).add(posVec); Vec3d vec = rotationVec.multiply(i / multiplier).add(posVec);
((ServerWorld) world).spawnParticles(ParticleTypes.END_ROD, vec.getX(), vec.getY(), vec.getZ(), 1, 0, 0, 0, 0.25f); ((ServerWorld) world).spawnParticles(ParticleTypes.END_ROD, vec.getX(), vec.getY(), vec.getZ(), 1, 0, 0, 0, 0.1f);
} }
} }

View File

@ -66,6 +66,10 @@ public class PassiveBatteryControllerBlockEntity extends EnergyReceiverBlockEnti
return false; return false;
} }
public static boolean isInvalidBlock(BlockState block) {
return !block.isOf(EnergonRelics.THERMAL_GLASS_BLOCK) && !block.isOf(EnergonRelics.THERMAL_CASING_BLOCK);
}
@Override @Override
public void setEnergy(long value) { public void setEnergy(long value) {
BatteryCoreBlockEntity core = getBatteryCore(); BatteryCoreBlockEntity core = getBatteryCore();
@ -111,7 +115,7 @@ public class PassiveBatteryControllerBlockEntity extends EnergyReceiverBlockEnti
for (Direction side : Direction.values()) { for (Direction side : Direction.values()) {
if (side != facing) { if (side != facing) {
BlockState state = getWorld().getBlockState(corePos.offset(side)); BlockState state = getWorld().getBlockState(corePos.offset(side));
if (state == null || state.getBlock() != EnergonRelics.THERMAL_CASING_BLOCK) { if (state == null || isInvalidBlock(state)) {
valid = false; valid = false;
break; break;
} }

View File

@ -3,6 +3,7 @@ package com.thebrokenrail.energonrelics.block.entity.reactor;
import com.thebrokenrail.energonrelics.Config; import com.thebrokenrail.energonrelics.Config;
import com.thebrokenrail.energonrelics.EnergonRelics; import com.thebrokenrail.energonrelics.EnergonRelics;
import com.thebrokenrail.energonrelics.block.battery.PassiveBatteryControllerBlock; import com.thebrokenrail.energonrelics.block.battery.PassiveBatteryControllerBlock;
import com.thebrokenrail.energonrelics.block.entity.battery.PassiveBatteryControllerBlockEntity;
import com.thebrokenrail.energonrelics.block.reactor.ReactorControllerBlock; import com.thebrokenrail.energonrelics.block.reactor.ReactorControllerBlock;
import com.thebrokenrail.energonrelics.energy.helper.EnergyGeneratorBlockEntity; import com.thebrokenrail.energonrelics.energy.helper.EnergyGeneratorBlockEntity;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
@ -81,7 +82,7 @@ public class ReactorControllerBlockEntity extends EnergyGeneratorBlockEntity {
inputs.add((ReactorInputBlockEntity) potentialInput); inputs.add((ReactorInputBlockEntity) potentialInput);
} else { } else {
BlockState state = getWorld().getBlockState(checkPos); BlockState state = getWorld().getBlockState(checkPos);
if (state == null || state.getBlock() != EnergonRelics.THERMAL_CASING_BLOCK) { if (state == null || PassiveBatteryControllerBlockEntity.isInvalidBlock(state)) {
valid = false; valid = false;
break; break;
} }

View File

@ -1,7 +1,7 @@
package com.thebrokenrail.energonrelics.block.util; package com.thebrokenrail.energonrelics.block.util;
import com.thebrokenrail.energonrelics.EnergonRelics; import com.thebrokenrail.energonrelics.EnergonRelics;
import com.thebrokenrail.energonrelics.client.render.HighlightBlockEntityRenderer; import com.thebrokenrail.energonrelics.client.block.entity.render.HighlightBlockEntityRenderer;
import com.thebrokenrail.energonrelics.component.NetworkComponent; import com.thebrokenrail.energonrelics.component.NetworkComponent;
import com.thebrokenrail.energonrelics.energy.core.EnergyProviderBlockEntity; import com.thebrokenrail.energonrelics.energy.core.EnergyProviderBlockEntity;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;

View File

@ -13,6 +13,7 @@ public class EnergonRelicsClient implements ClientModInitializer {
@Override @Override
public void onInitializeClient() { public void onInitializeClient() {
EnergyProviderBlock.initRenderer(); EnergyProviderBlock.initRenderer();
BlockRenderLayerMap.INSTANCE.putBlock(EnergonRelics.THERMAL_GLASS_BLOCK, RenderLayer.getCutout());
BlockRenderLayerMap.INSTANCE.putBlock(EnergonRelics.DEFENSIVE_LASER_BLOCK, RenderLayer.getCutout()); BlockRenderLayerMap.INSTANCE.putBlock(EnergonRelics.DEFENSIVE_LASER_BLOCK, RenderLayer.getCutout());
} }
} }

View File

@ -1,4 +1,4 @@
package com.thebrokenrail.energonrelics.client.render; package com.thebrokenrail.energonrelics.client.block.entity.render;
import com.thebrokenrail.energonrelics.EnergonRelics; import com.thebrokenrail.energonrelics.EnergonRelics;
import com.thebrokenrail.energonrelics.block.entity.DefensiveLaserBlockEntity; import com.thebrokenrail.energonrelics.block.entity.DefensiveLaserBlockEntity;

View File

@ -1,4 +1,4 @@
package com.thebrokenrail.energonrelics.client.render; package com.thebrokenrail.energonrelics.client.block.entity.render;
import com.thebrokenrail.energonrelics.EnergonRelics; import com.thebrokenrail.energonrelics.EnergonRelics;
import com.thebrokenrail.energonrelics.energy.core.EnergyReceiverBlockEntity; import com.thebrokenrail.energonrelics.energy.core.EnergyReceiverBlockEntity;
@ -27,7 +27,7 @@ public class HighlightBlockEntityRenderer extends BlockEntityRenderer<BlockEntit
} }
private static RenderLayer getLayer() { private static RenderLayer getLayer() {
return RenderLayer.of("fasterthanc_holographic_sky", VertexFormats.POSITION_COLOR, 7, 256, false, true, RenderLayer.MultiPhaseParameters.builder().transparency(RenderPhaseAccessor.getTRANSLUCENT_TRANSPARENCY()).layering(RenderPhaseAccessor.getVIEW_OFFSET_Z_LAYERING()).build(false)); return RenderLayer.of("energonrelics_highlight", VertexFormats.POSITION_COLOR, 7, 256, false, true, RenderLayer.MultiPhaseParameters.builder().transparency(RenderPhaseAccessor.getTRANSLUCENT_TRANSPARENCY()).layering(RenderPhaseAccessor.getVIEW_OFFSET_Z_LAYERING()).build(false));
} }
private static final RenderLayer LAYER = getLayer(); private static final RenderLayer LAYER = getLayer();

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "energonrelics:block/thermal_glass"
}
}
}

View File

@ -9,6 +9,7 @@
"text.energonrelics.energy_required": "Energy Required: %s Energon", "text.energonrelics.energy_required": "Energy Required: %s Energon",
"text.energonrelics.energy_available": "Energy Available: %s Energon", "text.energonrelics.energy_available": "Energy Available: %s Energon",
"block.energonrelics.thermal_casing": "Thermal Casing", "block.energonrelics.thermal_casing": "Thermal Casing",
"block.energonrelics.thermal_glass": "Thermal Glass",
"block.energonrelics.battery_core": "Battery Core", "block.energonrelics.battery_core": "Battery Core",
"block.energonrelics.passive_battery_controller": "Passive Battery Controller", "block.energonrelics.passive_battery_controller": "Passive Battery Controller",
"block.energonrelics.active_battery_controller": "Active Battery Controller", "block.energonrelics.active_battery_controller": "Active Battery Controller",

View File

@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "energonrelics:block/thermal_glass"
}
}

View File

@ -0,0 +1,3 @@
{
"parent": "energonrelics:block/thermal_glass"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 732 B

After

Width:  |  Height:  |  Size: 771 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

View File

@ -0,0 +1,19 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "energonrelics:defensive_laser"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}

View File

@ -0,0 +1,19 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "energonrelics:thermal_glass"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}

View File

@ -2,7 +2,7 @@
"type": "minecraft:crafting_shaped", "type": "minecraft:crafting_shaped",
"pattern": [ "pattern": [
"#I#", "#I#",
"IGI", "IDI",
"#I#" "#I#"
], ],
"key": { "key": {
@ -12,8 +12,8 @@
"I": { "I": {
"item": "minecraft:gold_ingot" "item": "minecraft:gold_ingot"
}, },
"G": { "D": {
"item": "minecraft:gunpowder" "item": "minecraft:diamond"
} }
}, },
"result": { "result": {

View File

@ -18,6 +18,6 @@
}, },
"result": { "result": {
"item": "energonrelics:solar_panel", "item": "energonrelics:solar_panel",
"count": 1 "count": 2
} }
} }

View File

@ -0,0 +1,20 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
" # ",
"#G#",
" # "
],
"key": {
"#": {
"item": "energonrelics:thermal_casing"
},
"G": {
"item": "minecraft:glass"
}
},
"result": {
"item": "energonrelics:thermal_glass",
"count": 2
}
}