New Dynamo

This commit is contained in:
yuesha-yc 2021-10-26 00:00:12 -07:00
parent c05f8d5527
commit 03d58412ba
No known key found for this signature in database
GPG key ID: 009D79A802D4ED01
20 changed files with 377 additions and 300 deletions

View file

@ -36,7 +36,6 @@ public class SPConfig {
public final ForgeConfigSpec.IntValue steelFlywheelSteamConsumptionPerTick;
public final ForgeConfigSpec.IntValue steelFlywheelSteamStorage;
public final ForgeConfigSpec.IntValue dynamoFeMaxIn;
public final ForgeConfigSpec.IntValue dynamoFeMaxOut;
public final ForgeConfigSpec.IntValue dynamoFeCapacity;
public final ForgeConfigSpec.IntValue dynamoImpact;
@ -79,7 +78,6 @@ public class SPConfig {
builder.push("dynamo").comment("If dynamo is disabled in the server config, the following will be ignored!");
{
dynamoFeMaxIn = builder.defineInRange("dynamoFeMaxIn", 0, 0, 8192);
dynamoFeMaxOut = builder.defineInRange("dynamoFeMaxOut", 256, 0, 8192);
dynamoFeCapacity = builder.defineInRange("dynamoFeCapacity", 2048, 0, 8192);
dynamoImpact = builder.defineInRange("dynamoImpact", 16, 0, 8192);
@ -101,7 +99,7 @@ public class SPConfig {
public final ForgeConfigSpec.BooleanValue allowUnverifiedContraption;
public final ForgeConfigSpec.BooleanValue allowCartAssembler;
public final ForgeConfigSpec.BooleanValue disableSteamPoweredDynamo;
public final ForgeConfigSpec.BooleanValue disableDynamo;
Server(ForgeConfigSpec.Builder builder) {
builder.push("createmodify");
@ -112,7 +110,21 @@ public class SPConfig {
builder.pop();
builder.push("dynamo");
{
disableSteamPoweredDynamo = builder.comment("Set to false to enable this mod's dynamo.").define("disableSteamPoweredDynamo", true);
disableDynamo = builder
.comment("Set to true to DISABLE the DynamoBlock ONLY when Create: Crafts & Additions is loaded")
.comment("Create: Crafts & Additions is a mod which provides a similar electricity generation device called Alternator")
.comment("For pack developers who think having two similar devices is superfluous, you have two choices:")
.comment("Either you can set this config option to true and remove the DynamoBlock recipe through datapack")
.comment("Or if you instead want to use our DynamoBlock, you can remove the Alternator's recipe through datapack")
.comment("How to make datapack? Learn it from here: https://minecraft.gamepedia.com/Data_Pack")
.comment("However, please refer to the following: ")
.comment("We offers a redstone lock mechanism so that you can disconnect the DynamoBlock with redstone signal")
.comment("We offers a different model which provides different textures according to redstone status")
.comment("Clarification: As of Ver 1.1.1, Create: Steam Powered's DynamoBlock ONLY adapts from")
.comment("the code implementation of the Alternator created by MRH0, which is under MIT License")
.comment("We acknowledge and appreciate the great work done by MRH0. We learn from his code")
.comment("MRH0 is also under our credits list in mods.toml description")
.define("disableDynamo", false);
}
builder.pop();
}

View file

@ -1,51 +0,0 @@
/**
* Available under MIT the license more info at: https://tldrlegal.com/license/mit-license
*
* MIT License
*
* Copyright 2021 MRH0
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction,
* including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom t
* he Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.teammoeg.steampowered.client.render;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
import com.simibubi.create.foundation.render.PartialBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
/**
* Adapted from: Create: Crafts & Additions
* @author MRH0
*/
public class AlternatorRenderer extends KineticTileEntityRenderer {
public AlternatorRenderer(TileEntityRendererDispatcher dispatcher) {
super(dispatcher);
}
@Override
protected SuperByteBuffer getRotatedModel(KineticTileEntity te) {
return PartialBufferer.getFacing(AllBlockPartials.SHAFT_HALF, te.getBlockState());
}
}

View file

@ -0,0 +1,38 @@
/*
* Copyright (c) 2021 TeamMoeg
*
* This file is part of Steam Powered.
*
* Steam Powered is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* Steam Powered is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Steam Powered. If not, see <https://www.gnu.org/licenses/>.
*/
package com.teammoeg.steampowered.client.render;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
import com.simibubi.create.foundation.render.PartialBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
public class DynamoRenderer extends KineticTileEntityRenderer {
public DynamoRenderer(TileEntityRendererDispatcher dispatcher) {
super(dispatcher);
}
@Override
protected SuperByteBuffer getRotatedModel(KineticTileEntity te) {
return PartialBufferer.getFacing(AllBlockPartials.SHAFT_HALF, te.getBlockState());
}
}

View file

@ -1,142 +0,0 @@
/**
* Available under MIT the license more info at: https://tldrlegal.com/license/mit-license
*
* MIT License
*
* Copyright 2021 MRH0
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction,
* including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom t
* he Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.teammoeg.steampowered.content.alternator;
import com.simibubi.create.content.contraptions.base.DirectionalKineticBlock;
import com.simibubi.create.content.contraptions.base.IRotate;
import com.simibubi.create.foundation.block.ITE;
import com.simibubi.create.foundation.utility.VoxelShaper;
import com.teammoeg.steampowered.SPConfig;
import com.teammoeg.steampowered.block.SPShapes;
import com.teammoeg.steampowered.registrate.SPTiles;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction;
import net.minecraft.util.Direction.Axis;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IWorldReader;
import net.minecraft.world.World;
import java.util.List;
/**
* Adapted from: Create: Crafts & Additions
* @author MRH0
*/
public class AlternatorBlock extends DirectionalKineticBlock implements ITE<AlternatorTileEntity>, IRotate {
public static final VoxelShaper ALTERNATOR_SHAPE = SPShapes.shape(0, 3, 0, 16, 13, 16).add(2, 0, 2, 14, 14, 14).forDirectional();
@Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
return ALTERNATOR_SHAPE.get(state.getValue(FACING));
}
@Override
public BlockState getStateForPlacement(BlockItemUseContext context) {
Direction preferred = getPreferredFacing(context);
if ((context.getPlayer() != null && context.getPlayer()
.isShiftKeyDown()) || preferred == null)
return super.getStateForPlacement(context);
return defaultBlockState().setValue(FACING, preferred);
}
public AlternatorBlock(Properties properties) {
super(properties);
}
@Override
public boolean hasShaftTowards(IWorldReader world, BlockPos pos, BlockState state, Direction face) {
return face == state.getValue(FACING);
}
@Override
public Axis getRotationAxis(BlockState state) {
return state.getValue(FACING)
.getAxis();
}
@Override
public Class<AlternatorTileEntity> getTileEntityClass() {
return AlternatorTileEntity.class;
}
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return SPTiles.ALTERNATOR.create();
}
@Override
public SpeedLevel getMinimumRequiredSpeedLevel() {
return SpeedLevel.MEDIUM;
}
@Override
public void neighborChanged(BlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos, boolean isMoving) {
TileEntity tileentity = state.hasTileEntity() ? worldIn.getBlockEntity(pos) : null;
if (tileentity != null) {
if (tileentity instanceof AlternatorTileEntity) {
((AlternatorTileEntity) tileentity).updateCache();
}
}
}
@Override
public void fillItemCategory(ItemGroup group, NonNullList<ItemStack> itemStacks) {
if (SPConfig.SERVER.disableSteamPoweredDynamo.get()) {
// dynamo disabled
} else {
super.fillItemCategory(group, itemStacks);
}
}
@Override
public void appendHoverText(ItemStack i, IBlockReader w, List<ITextComponent> t, ITooltipFlag f) {
if (SPConfig.SERVER.disableSteamPoweredDynamo.get()) {
t.add(new StringTextComponent("Dynamo is disabled in the server config").withStyle(TextFormatting.RED));
} else {
t.add(new StringTextComponent("Dynamo adapted from the mod Create: Crafts & Additions. Credits: MRH0").withStyle(TextFormatting.RED));
t.add(new StringTextComponent("Codes and assets under MIT License").withStyle(TextFormatting.RED));
t.add(new TranslationTextComponent("block.steampowered.alternator.tooltip.summary").withStyle(TextFormatting.GRAY));
}
super.appendHoverText(i,w,t,f);
}
}

View file

@ -0,0 +1,166 @@
/*
* Copyright (c) 2021 TeamMoeg
*
* This file is part of Steam Powered.
*
* Steam Powered is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* Steam Powered is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Steam Powered. If not, see <https://www.gnu.org/licenses/>.
*/
package com.teammoeg.steampowered.content.alternator;
import com.simibubi.create.content.contraptions.base.DirectionalKineticBlock;
import com.simibubi.create.content.contraptions.base.IRotate;
import com.simibubi.create.foundation.block.ITE;
import com.simibubi.create.foundation.utility.VoxelShaper;
import com.teammoeg.steampowered.SPConfig;
import com.teammoeg.steampowered.block.SPShapes;
import com.teammoeg.steampowered.registrate.SPTiles;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction;
import net.minecraft.util.Direction.Axis;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IWorldReader;
import net.minecraft.world.World;
import net.minecraft.world.server.ServerWorld;
import net.minecraftforge.fml.ModList;
import java.util.List;
import java.util.Random;
/**
* Adapted from: Create: Crafts & Additions
* @author MRH0
* @author yuesha-yc
*/
public class DynamoBlock extends DirectionalKineticBlock implements ITE<DynamoTileEntity>, IRotate {
public static final BooleanProperty REDSTONE_LOCKED = BooleanProperty.create("redstone_locked");
//TODO: Fix shape
public static final VoxelShaper ALTERNATOR_SHAPE = SPShapes.shape(0, 3, 0, 16, 13, 16).add(2, 0, 2, 14, 14, 14).forDirectional();
@Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
return ALTERNATOR_SHAPE.get(state.getValue(FACING));
}
@Override
public BlockState getStateForPlacement(BlockItemUseContext context) {
Direction preferred = getPreferredFacing(context);
if ((context.getPlayer() != null && context.getPlayer().isShiftKeyDown()) || preferred == null) {
return super.getStateForPlacement(context).setValue(REDSTONE_LOCKED, context.getLevel().hasNeighborSignal(context.getClickedPos()));
}
return defaultBlockState().setValue(FACING, preferred).setValue(REDSTONE_LOCKED, context.getLevel().hasNeighborSignal(context.getClickedPos()));
}
public DynamoBlock(Properties properties) {
super(properties);
this.registerDefaultState(this.stateDefinition.any().setValue(REDSTONE_LOCKED, false));
}
protected void createBlockStateDefinition(StateContainer.Builder<Block, BlockState> builder) {
super.createBlockStateDefinition(builder.add(REDSTONE_LOCKED));
}
@Override
public boolean hasShaftTowards(IWorldReader world, BlockPos pos, BlockState state, Direction face) {
return face == state.getValue(FACING);
}
@Override
public Axis getRotationAxis(BlockState state) {
return state.getValue(FACING)
.getAxis();
}
@Override
public Class<DynamoTileEntity> getTileEntityClass() {
return DynamoTileEntity.class;
}
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return SPTiles.DYNAMO.create();
}
@Override
public SpeedLevel getMinimumRequiredSpeedLevel() {
return SpeedLevel.MEDIUM;
}
@Override
public void fillItemCategory(ItemGroup group, NonNullList<ItemStack> itemStacks) {
if (ModList.get().isLoaded("createaddition") && SPConfig.SERVER.disableDynamo.get()) {
// removes dynamo from creative tab when CC&A is loaded AND config is set to true
} else {
super.fillItemCategory(group, itemStacks);
}
}
@Override
public void appendHoverText(ItemStack i, IBlockReader w, List<ITextComponent> t, ITooltipFlag f) {
t.add(new TranslationTextComponent("block.steampowered.dynamo.tooltip.summary").withStyle(TextFormatting.GRAY));
t.add(new StringTextComponent("We adapt and appreciate MRH0's code").withStyle(TextFormatting.GRAY));
if (ModList.get().isLoaded("createaddition")) {
if (SPConfig.SERVER.disableDynamo.get()) {
t.add(new StringTextComponent("Dynamo is disabled in [save]/serverconfig/steampowered-server.toml").withStyle(TextFormatting.RED));
}
}
super.appendHoverText(i,w,t,f);
}
@Override
public void neighborChanged(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean flag) {
if (!world.isClientSide) {
TileEntity tileentity = state.hasTileEntity() ? world.getBlockEntity(pos) : null;
if (tileentity != null) {
if (tileentity instanceof DynamoTileEntity) {
((DynamoTileEntity) tileentity).updateCache();
}
}
boolean isLocked = state.getValue(REDSTONE_LOCKED);
if (isLocked != world.hasNeighborSignal(pos)) {
if (isLocked) {
world.getBlockTicks().scheduleTick(pos, this, 4);
} else {
world.setBlock(pos, state.cycle(REDSTONE_LOCKED), 2);
}
}
}
}
@Override
public void tick(BlockState state, ServerWorld serverworld, BlockPos pos, Random random) {
if (state.getValue(REDSTONE_LOCKED) && !serverworld.hasNeighborSignal(pos)) {
serverworld.setBlock(pos, state.cycle(REDSTONE_LOCKED), 2);
}
}
}

View file

@ -1,28 +1,19 @@
/**
* Available under MIT the license more info at: https://tldrlegal.com/license/mit-license
/*
* Copyright (c) 2021 TeamMoeg
*
* MIT License
* This file is part of Steam Powered.
*
* Copyright 2021 MRH0
* Steam Powered is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction,
* including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom t
* he Software is furnished to do so, subject to the following conditions:
* Steam Powered is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* You should have received a copy of the GNU General Public License
* along with Steam Powered. If not, see <https://www.gnu.org/licenses/>.
*/
package com.teammoeg.steampowered.content.alternator;
@ -51,25 +42,26 @@ import net.minecraftforge.energy.IEnergyStorage;
import java.util.List;
/**
* Adapted from: Create: Crafts & Additions
* Adapted from: Create: Crafts & Additions under the MIT License
* @author MRH0
* @author yuesha-yc
*/
public class AlternatorTileEntity extends KineticTileEntity {
public class DynamoTileEntity extends KineticTileEntity {
protected final InternalEnergyStorage energy;
private LazyOptional<IEnergyStorage> lazyEnergy;
private boolean redstoneLocked = false;
private static final int
MAX_FE_IN = SPConfig.COMMON.dynamoFeMaxIn.get(),
MAX_FE_OUT = SPConfig.COMMON.dynamoFeMaxOut.get(), // FE Output
FE_CAPACITY = SPConfig.COMMON.dynamoFeCapacity.get(), // FE Storage
IMPACT = SPConfig.COMMON.dynamoImpact.get(); // Impact on network
private static final double
EFFICIENCY = SPConfig.COMMON.dynamoEfficiency.get();
public AlternatorTileEntity(TileEntityType<?> typeIn) {
public DynamoTileEntity(TileEntityType<?> typeIn) {
super(typeIn);
energy = new InternalEnergyStorage(FE_CAPACITY, MAX_FE_IN, MAX_FE_OUT);
energy = new InternalEnergyStorage(FE_CAPACITY, 0, MAX_FE_OUT);
lazyEnergy = LazyOptional.of(() -> energy);
}
@ -107,19 +99,21 @@ public class AlternatorTileEntity extends KineticTileEntity {
}
public boolean isEnergyOutput(Direction side) {
return side != getBlockState().getValue(AlternatorBlock.FACING);
return side != getBlockState().getValue(DynamoBlock.FACING);
}
@Override
public void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
super.fromTag(state, compound, clientPacket);
energy.read(compound);
redstoneLocked = compound.getBoolean("redstonelocked");
}
@Override
public void write(CompoundNBT compound, boolean clientPacket) {
super.write(compound, clientPacket);
energy.write(compound);
compound.putBoolean("redstonelocked", redstoneLocked);
}
private boolean firstTickState = true;
@ -129,6 +123,10 @@ public class AlternatorTileEntity extends KineticTileEntity {
super.tick();
if (level != null && level.isClientSide())
return;
if (this.getBlockState().getValue(DynamoBlock.REDSTONE_LOCKED))
return;
if (firstTickState)
firstTick();
firstTickState = false;
@ -167,8 +165,6 @@ public class AlternatorTileEntity extends KineticTileEntity {
updateCache();
}
;
public void updateCache() {
if (level.isClientSide())
return;

View file

@ -54,8 +54,8 @@ public class SPPonderIndex {
STEAM_HELPER.forComponents(SPBlocks.BRONZE_FLYWHEEL, SPBlocks.CAST_IRON_FLYWHEEL, SPBlocks.STEEL_FLYWHEEL)
.addStoryBoard("steam_engine", SPScenes::steamFlywheel, PonderTag.KINETIC_SOURCES, STEAM);
STEAM_HELPER.forComponents(SPBlocks.ALTERNATOR)
.addStoryBoard("alternator", SPScenes::alternator, PonderTag.KINETIC_APPLIANCES, STEAM);
STEAM_HELPER.forComponents(SPBlocks.DYNAMO)
.addStoryBoard("dynamo", SPScenes::dynamo, PonderTag.KINETIC_APPLIANCES, STEAM);
}
}

View file

@ -194,8 +194,8 @@ public class SPScenes {
scene.overlay.showText(80).placeNearTarget().colored(PonderPalette.MEDIUM).pointAt(util.vector.topOf(enginePos.west())).text(text3);
}
public static void alternator(SceneBuilder scene, SceneBuildingUtil util) {
scene.title("alternator", "Generating Electric energy using a Alternator");
public static void dynamo(SceneBuilder scene, SceneBuildingUtil util) {
scene.title("dynamo", "Generating Electric energy using a Dynamo");
scene.configureBasePlate(1, 0, 4);
scene.world.showSection(util.select.layer(0), Direction.UP);
@ -209,7 +209,7 @@ public class SPScenes {
scene.idle(10);
scene.overlay.showText(50)
.text("The Alternator generates electric energy (fe) from rotational force")
.text("The Dynamo generates electric energy (fe) from rotational force")
.placeNearTarget()
.pointAt(util.vector.topOf(generator));
scene.idle(60);
@ -222,7 +222,7 @@ public class SPScenes {
scene.overlay.showText(50)
.text("The Alternators energy production is determined by the input RPM")
.text("The Dynamos energy production is determined by the input RPM")
.placeNearTarget()
.pointAt(util.vector.topOf(generator));
scene.idle(60);

View file

@ -31,7 +31,7 @@ import com.simibubi.create.foundation.data.SharedProperties;
import com.simibubi.create.repack.registrate.util.entry.BlockEntry;
import com.teammoeg.steampowered.SPConfig;
import com.teammoeg.steampowered.SteamPowered;
import com.teammoeg.steampowered.content.alternator.AlternatorBlock;
import com.teammoeg.steampowered.content.alternator.DynamoBlock;
import com.teammoeg.steampowered.content.boiler.CastIronBoilerBlock;
import com.teammoeg.steampowered.content.boiler.SteelBoilerBlock;
import com.teammoeg.steampowered.content.burner.CastIronBurnerBlock;
@ -172,7 +172,7 @@ public class SPBlocks {
.build()
.register();
public static final BlockEntry<AlternatorBlock> ALTERNATOR = REGISTRATE.block("alternator", AlternatorBlock::new)
public static final BlockEntry<DynamoBlock> DYNAMO = REGISTRATE.block("alternator", DynamoBlock::new)
.initialProperties(SPBlocks::hardMetal)
.transform(BlockStressDefaults.setImpact(4.0))
.tag(AllTags.AllBlockTags.SAFE_NBT.tag) //Dono what this tag means (contraption safe?).

View file

@ -28,12 +28,11 @@ import com.teammoeg.steampowered.SteamPowered;
import com.teammoeg.steampowered.client.instance.BronzeFlywheelInstance;
import com.teammoeg.steampowered.client.instance.CastIronFlywheelInstance;
import com.teammoeg.steampowered.client.instance.SteelFlywheelInstance;
import com.teammoeg.steampowered.client.render.AlternatorRenderer;
import com.teammoeg.steampowered.client.render.DynamoRenderer;
import com.teammoeg.steampowered.client.render.BronzeFlywheelRenderer;
import com.teammoeg.steampowered.client.render.CastIronFlywheelRenderer;
import com.teammoeg.steampowered.client.render.SteelFlywheelRenderer;
import com.teammoeg.steampowered.content.alternator.AlternatorTileEntity;
import com.teammoeg.steampowered.content.boiler.CastIronBoilerBlock;
import com.teammoeg.steampowered.content.alternator.DynamoTileEntity;
import com.teammoeg.steampowered.content.boiler.CastIronBoilerTileEntity;
import com.teammoeg.steampowered.content.boiler.SteelBoilerTileEntity;
import com.teammoeg.steampowered.content.burner.CastIronBurnerTileEntity;
@ -101,11 +100,11 @@ public class SPTiles {
.renderer(() -> KineticTileEntityRenderer::new)
.register();
public static final TileEntityEntry<AlternatorTileEntity> ALTERNATOR = REGISTRATE
.tileEntity("alternator", AlternatorTileEntity::new)
public static final TileEntityEntry<DynamoTileEntity> DYNAMO = REGISTRATE
.tileEntity("alternator", DynamoTileEntity::new)
.instance(() -> HalfShaftInstance::new)
.validBlocks(SPBlocks.ALTERNATOR)
.renderer(() -> AlternatorRenderer::new)
.validBlocks(SPBlocks.DYNAMO)
.renderer(() -> DynamoRenderer::new)
.register();
public static final TileEntityEntry<FlywheelTileEntity> BRONZE_STEAM_FLYWHEEL = REGISTRATE

View file

@ -1,27 +1,51 @@
{
"variants": {
"facing=down": {
"model": "steampowered:block/alternator/block",
"facing=down,redstone_locked=false": {
"model": "steampowered:block/dynamo/block",
"x": 270, "y": 90
},
"facing=up": {
"model": "steampowered:block/alternator/block",
"facing=up,redstone_locked=false": {
"model": "steampowered:block/dynamo/block",
"x": 90, "y": 90
},
"facing=north": {
"model": "steampowered:block/alternator/block",
"facing=north,redstone_locked=false": {
"model": "steampowered:block/dynamo/block",
"y": 180
},
"facing=south": {
"model": "steampowered:block/alternator/block",
"facing=south,redstone_locked=false": {
"model": "steampowered:block/dynamo/block",
"y": 0
},
"facing=west": {
"model": "steampowered:block/alternator/block",
"facing=west,redstone_locked=false": {
"model": "steampowered:block/dynamo/block",
"y": 90
},
"facing=east": {
"model": "steampowered:block/alternator/block",
"facing=east,redstone_locked=false": {
"model": "steampowered:block/dynamo/block",
"y": 270
},
"facing=down,redstone_locked=true": {
"model": "steampowered:block/dynamo/block_locked",
"x": 270, "y": 90
},
"facing=up,redstone_locked=true": {
"model": "steampowered:block/dynamo/block_locked",
"x": 90, "y": 90
},
"facing=north,redstone_locked=true": {
"model": "steampowered:block/dynamo/block_locked",
"y": 180
},
"facing=south,redstone_locked=true": {
"model": "steampowered:block/dynamo/block_locked",
"y": 0
},
"facing=west,redstone_locked=true": {
"model": "steampowered:block/dynamo/block_locked",
"y": 90
},
"facing=east,redstone_locked=true": {
"model": "steampowered:block/dynamo/block_locked",
"y": 270
}
}

View file

@ -40,20 +40,13 @@
"tooltip.steampowered.steam_engine.not_enough_steam": "Status: Not Enough Steam",
"tooltip.steampowered.steam_engine.running": "Status: Running",
"item.steampowered.multimeter": "Multimeter",
"item.steampowered.multimeter.title":"[Multimeter]:",
"item.steampowered.multimeter.measuring":"[Measuring..]",
"item.steampowered.multimeter.ticks":"ticks",
"item.steampowered.multimeter.no_capability":"No Forge Energy capability on this side.",
"item.steampowered.multimeter.tooltip.summary": "Measures capacity and input/output on any side with a Forge Energy capability.",
"block.steampowered.alternator": "Dynamo",
"block.steampowered.alternator.tooltip.summary": "Generates FE from SU. The amount of energy produced is based on RPM.",
"block.steampowered.dynamo.tooltip.summary": "Generates FE from SU. The amount of energy produced is based on RPM.",
"steampowered.ponder.alternator.header": "Generating Electric energy using an Alternator",
"steampowered.ponder.alternator.text_1": "The Alternator requires at least 32 RPM to operate",
"steampowered.ponder.alternator.text_2": "It generates electric energy (FE) from rotational force",
"steampowered.ponder.alternator.text_3": "It's energy production is determined by the input RPM",
"steampowered.ponder.dynamo.header": "Generating Electric energy using a Dynamo",
"steampowered.ponder.dynamo.text_1": "The Dynamo requires at least 32 RPM to operate",
"steampowered.ponder.dynamo.text_2": "It generates electric energy (FE) from rotational force",
"steampowered.ponder.dynamo.text_3": "It's energy production is determined by the input RPM",
"steampowered.ponder.tag.steam": "Steam",
"steampowered.ponder.tag.steam.description": "Components related to steam production and usage",

View file

@ -16,12 +16,12 @@
"block.steampowered.bronze_large_cogwheel": "青銅の大きな歯車",
"block.steampowered.cast_iron_large_cogwheel": "鋳鉄の大きな歯車",
"block.steampowered.steel_large_cogwheel": "鋼鉄の大きな歯車",
"block.steampowered.bronze_boiler" : "Bronze Boiler",
"block.steampowered.cast_iron_boiler" : "Cast Iron Boiler",
"block.steampowered.steel_boiler" : "Steel Boiler",
"block.steampowered.bronze_burner" : "Bronze Burning Chamber",
"block.steampowered.cast_iron_burner" : "Cast Iron Burning Chamber",
"block.steampowered.steel_burner" : "Steel Burning Chamber",
"block.steampowered.bronze_boiler": "Bronze Boiler",
"block.steampowered.cast_iron_boiler": "Cast Iron Boiler",
"block.steampowered.steel_boiler": "Steel Boiler",
"block.steampowered.bronze_burner": "Bronze Burning Chamber",
"block.steampowered.cast_iron_burner": "Cast Iron Burning Chamber",
"block.steampowered.steel_burner": "Steel Burning Chamber",
"fluid.steampowered.steam": "蒸気",
"fluid.steampowered.steam_following": "蒸気",
@ -40,28 +40,31 @@
"tooltip.steampowered.steam_engine.not_enough_steam": "状態: 蒸気不足",
"tooltip.steampowered.steam_engine.running": "状態: 稼働中",
"item.steampowered.multimeter": "マルチメーター",
"item.steampowered.multimeter.title":"[マルチメーター]:",
"item.steampowered.multimeter.measuring":"[計測中..]",
"item.steampowered.multimeter.ticks":"ticks",
"item.steampowered.multimeter.no_capability":"この面にはForge Energyの機能はありません",
"item.steampowered.multimeter.tooltip.summary": "_Forge Energy機能_を持つ任意の面の_容量と_入出力_を計測します",
"block.steampowered.alternator": "オルタネーター",
"block.steampowered.alternator.tooltip.summary": "_su_から_FE_を発電します。発電量は_rpm_で決まります",
"block.steampowered.dynamo.tooltip.summary": "_su_から_FE_を発電します。発電量は_rpm_で決まります",
"steampowered.ponder.alternator.header": "オルタネーターによる発電",
"steampowered.ponder.alternator.text_1": "オルタネーターの動作には最低でも32RPMが必要です",
"steampowered.ponder.alternator.text_2": "回転力で電気(FE)を発電します",
"steampowered.ponder.alternator.text_3": "発電量は供給される_RPM_(回転速度)で決まります",
"steampowered.ponder.dynamo.header": "オルタネーターによる発電",
"steampowered.ponder.dynamo.text_1": "オルタネーターの動作には最低でも32RPMが必要です",
"steampowered.ponder.dynamo.text_2": "回転力で電気(FE)を発電します",
"steampowered.ponder.dynamo.text_3": "発電量は供給される_RPM_(回転速度)で決まります",
"steampowered.ponder.tag.steam": "蒸気",
"steampowered.ponder.tag.steam.description": "蒸気を生成・利用する機械",
"tooltip.steampowered.burner.hu": "Heat Remaining: %s HU",
"tooltip.steampowered.burner.item": "Fuel Remaining: %s x %s",
"tooltip.steampowered.burner.huproduce": "Generates %s HU/t",
"tooltip.steampowered.burner.danger": "Caution! Standing on when burning causes damage!",
"tooltip.steampowered.boiler.huconsume": "Maximum Heat Intake %s HU/t",
"tooltip.steampowered.boiler.waterconsume": "Requires Water %s mb/t",
"tooltip.steampowered.boiler.steamproduce": "Maximum Steam Output %s mb/t",
"tooltip.steampowered.boiler.danger": "Caution! Standing on when working causes damage!",
"steampowered.ponder.boiler.header": "Generating Steam through Boilers and Burning Chambers",
"steampowered.ponder.boiler.text_1": "The Boiler needs water to produce Steam",
"steampowered.ponder.boiler.text_2": "The Burning Chamber needs furnace fuel to heat the Boiler",
"steampowered.ponder.boiler.text_3": "Right click with fuel item such as Coal or Planks to provide it with fuel",
"steampowered.ponder.boiler.text_4": "Right click with empty hand to take out the remaining fuel",
"steampowered.ponder.boiler.text_5": "Pump the steam out of the boiler to power the Steam Engines"
}
}

View file

@ -40,20 +40,13 @@
"tooltip.steampowered.steam_engine.not_enough_steam": "状态:蒸汽不足",
"tooltip.steampowered.steam_engine.running": "状态:工作中",
"item.steampowered.multimeter": "万用表",
"item.steampowered.multimeter.title":"[万用表]",
"item.steampowered.multimeter.measuring":"[测量中..]",
"item.steampowered.multimeter.ticks":"刻",
"item.steampowered.multimeter.no_capability":"此面不支持 FE 功能",
"item.steampowered.multimeter.tooltip.summary": "测量任何一个有 FE 功能的面的容量与输入/输出",
"block.steampowered.alternator": "发电机",
"block.steampowered.alternator.tooltip.summary": "从应力产生 FE 能量,基于转速。",
"block.steampowered.dynamo.tooltip.summary": "从应力产生 FE 能量,基于转速。",
"steampowered.ponder.alternator.header": "使用交流发电机发电",
"steampowered.ponder.alternator.text_1": "交流发电机需要至少 32 rpm 的转速才能工作",
"steampowered.ponder.alternator.text_2": "它从旋转动力中产生电能FE",
"steampowered.ponder.alternator.text_3": "它产生能量的多少是由输入的转速决定的",
"steampowered.ponder.dynamo.header": "使用发电机发电",
"steampowered.ponder.dynamo.text_1": "发电机需要至少 32 rpm 的转速才能工作",
"steampowered.ponder.dynamo.text_2": "它从旋转动力中产生电能FE",
"steampowered.ponder.dynamo.text_3": "它产生能量的多少是由输入的转速决定的",
"steampowered.ponder.tag.steam": "蒸汽",
"steampowered.ponder.tag.steam.description": "使用或生产蒸汽的组件",

View file

@ -2,8 +2,8 @@
"credit": "Made with Blockbench, by goumo_g",
"texture_size": [32, 32],
"textures": {
"0": "steampowered:block/alternator/alternator",
"particle": "steampowered:block/alternator/alternator"
"0": "steampowered:block/dynamo/dynamo",
"particle": "steampowered:block/dynamo/dynamo"
},
"elements": [
{

View file

@ -0,0 +1,46 @@
{
"credit": "Made with Blockbench, by goumo_g",
"texture_size": [32, 32],
"textures": {
"0": "steampowered:block/dynamo/dynamo_locked",
"particle": "steampowered:block/dynamo/dynamo"
},
"elements": [
{
"from": [0, 0, 0],
"to": [16, 3, 16],
"faces": {
"north": {"uv": [8, 0, 16, 1.5], "texture": "#0"},
"east": {"uv": [8, 0, 16, 1.5], "texture": "#0"},
"south": {"uv": [8, 0, 16, 1.5], "texture": "#0"},
"west": {"uv": [8, 0, 16, 1.5], "texture": "#0"},
"up": {"uv": [0, 0, 8, 8], "texture": "#0"},
"down": {"uv": [0, 0, 8, 8], "texture": "#0"}
}
},
{
"from": [3, 3, 1],
"to": [13, 14, 12],
"faces": {
"north": {"uv": [10.5, 8, 15.5, 13.5], "texture": "#0"},
"east": {"uv": [5.5, 8, 0, 13.5], "texture": "#0"},
"south": {"uv": [10.5, 8, 15.5, 13.5], "texture": "#0"},
"west": {"uv": [0, 8, 5.5, 13.5], "texture": "#0"},
"up": {"uv": [5.5, 8, 10.5, 13.5], "texture": "#0"},
"down": {"uv": [5.5, 8, 10.5, 13.5], "texture": "#0"}
}
},
{
"from": [2, 3, 12],
"to": [14, 15, 16],
"faces": {
"north": {"uv": [8, 1.5, 14, 7.5], "texture": "#0"},
"east": {"uv": [14, 1.5, 16, 7.5], "texture": "#0"},
"south": {"uv": [8, 1.5, 14, 7.5], "texture": "#0"},
"west": {"uv": [14, 1.5, 16, 7.5], "texture": "#0"},
"up": {"uv": [14, 1.5, 16, 7.5], "rotation": 90, "texture": "#0"},
"down": {"uv": [14, 1.5, 16, 7.5], "rotation": 90, "texture": "#0"}
}
}
]
}

View file

@ -2,8 +2,8 @@
"credit": "Made with Blockbench, by goumo_g",
"texture_size": [32, 32],
"textures": {
"0": "steampowered:block/alternator/alternator",
"particle": "steampowered:block/alternator/alternator",
"0": "steampowered:block/dynamo/dynamo",
"particle": "steampowered:block/dynamo/dynamo",
"2": "create:block/axis",
"3": "create:block/axis_top"
},