diff --git a/src/main/java/org/terasology/entityNetwork/components/BlockLocationNetworkNodeComponent.java b/src/main/java/org/terasology/entityNetwork/components/BlockLocationNetworkNodeComponent.java index 273069f..715f789 100644 --- a/src/main/java/org/terasology/entityNetwork/components/BlockLocationNetworkNodeComponent.java +++ b/src/main/java/org/terasology/entityNetwork/components/BlockLocationNetworkNodeComponent.java @@ -1,29 +1,16 @@ -/* - * Copyright 2015 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.entityNetwork.components; import org.joml.Vector3i; -import org.terasology.engine.entitySystem.Component; import org.terasology.engine.entitySystem.entity.EntityRef; import org.terasology.engine.world.block.BlockComponent; import org.terasology.entityNetwork.BlockLocationNetworkNode; import org.terasology.entityNetwork.NetworkNode; import org.terasology.entityNetwork.NetworkNodeBuilder; +import org.terasology.gestalt.entitysystem.component.Component; -public class BlockLocationNetworkNodeComponent implements Component, NetworkNodeBuilder { +public class BlockLocationNetworkNodeComponent implements Component, NetworkNodeBuilder { public String networkId; public boolean isLeaf; public int maximumGridDistance = 1; @@ -37,4 +24,11 @@ public NetworkNode build(EntityRef entityRef) { return null; } } + + @Override + public void copyFrom(BlockLocationNetworkNodeComponent other) { + this.networkId = other.networkId; + this.isLeaf = other.isLeaf; + this.maximumGridDistance = other.maximumGridDistance; + } } diff --git a/src/main/java/org/terasology/entityNetwork/components/EntityNetworkComponent.java b/src/main/java/org/terasology/entityNetwork/components/EntityNetworkComponent.java index 29c19ea..f491caf 100644 --- a/src/main/java/org/terasology/entityNetwork/components/EntityNetworkComponent.java +++ b/src/main/java/org/terasology/entityNetwork/components/EntityNetworkComponent.java @@ -1,21 +1,12 @@ -/* - * Copyright 2015 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.entityNetwork.components; -import org.terasology.engine.entitySystem.Component; +import org.terasology.gestalt.entitysystem.component.Component; -public class EntityNetworkComponent implements Component { +public class EntityNetworkComponent implements Component { + @Override + public void copyFrom(EntityNetworkComponent other) { + + } } diff --git a/src/main/java/org/terasology/entityNetwork/components/SidedBlockLocationNetworkNodeComponent.java b/src/main/java/org/terasology/entityNetwork/components/SidedBlockLocationNetworkNodeComponent.java index 12cc90c..d7cd2a6 100644 --- a/src/main/java/org/terasology/entityNetwork/components/SidedBlockLocationNetworkNodeComponent.java +++ b/src/main/java/org/terasology/entityNetwork/components/SidedBlockLocationNetworkNodeComponent.java @@ -4,7 +4,6 @@ import com.google.common.collect.Sets; import org.joml.Vector3i; -import org.terasology.engine.entitySystem.Component; import org.terasology.engine.entitySystem.entity.EntityRef; import org.terasology.engine.math.Direction; import org.terasology.engine.math.Side; @@ -13,11 +12,12 @@ import org.terasology.entityNetwork.NetworkNode; import org.terasology.entityNetwork.NetworkNodeBuilder; import org.terasology.entityNetwork.SidedBlockLocationNetworkNode; +import org.terasology.gestalt.entitysystem.component.Component; import org.terasology.machines.BlockFamilyUtil; import java.util.Set; -public class SidedBlockLocationNetworkNodeComponent implements Component, NetworkNodeBuilder { +public class SidedBlockLocationNetworkNodeComponent implements Component, NetworkNodeBuilder { public String networkId; public boolean isLeaf; public Set directions = Sets.newHashSet(); @@ -42,4 +42,12 @@ private byte calculateConnectionSides(BlockComponent block) { } return SideBitFlag.getSides(sides); } + + @Override + public void copyFrom(SidedBlockLocationNetworkNodeComponent other) { + this.networkId = other.networkId; + this.isLeaf = other.isLeaf; + this.directions.clear(); + this.directions.addAll(other.directions); + } } diff --git a/src/main/java/org/terasology/fluidTransport/components/FluidDisplayComponent.java b/src/main/java/org/terasology/fluidTransport/components/FluidDisplayComponent.java index e3d4a5c..f61006e 100644 --- a/src/main/java/org/terasology/fluidTransport/components/FluidDisplayComponent.java +++ b/src/main/java/org/terasology/fluidTransport/components/FluidDisplayComponent.java @@ -1,25 +1,17 @@ -/* - * Copyright 2014 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.fluidTransport.components; -import org.terasology.engine.entitySystem.Component; import org.terasology.engine.entitySystem.Owns; import org.terasology.engine.entitySystem.entity.EntityRef; +import org.terasology.gestalt.entitysystem.component.Component; -public class FluidDisplayComponent implements Component { +public class FluidDisplayComponent implements Component { @Owns public EntityRef renderedEntity; + + @Override + public void copyFrom(FluidDisplayComponent other) { + + } } diff --git a/src/main/java/org/terasology/fluidTransport/components/FluidInletOutletComponent.java b/src/main/java/org/terasology/fluidTransport/components/FluidInletOutletComponent.java index 533cf7c..1676696 100644 --- a/src/main/java/org/terasology/fluidTransport/components/FluidInletOutletComponent.java +++ b/src/main/java/org/terasology/fluidTransport/components/FluidInletOutletComponent.java @@ -1,28 +1,15 @@ -/* - * Copyright 2014 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.fluidTransport.components; -import org.terasology.engine.entitySystem.Component; import org.terasology.engine.world.block.ForceBlockActive; +import org.terasology.gestalt.entitysystem.component.Component; /** * Marks a block that also has a FluidInventoryComponent as able to exchange fluid with adjacent liquid blocks. */ @ForceBlockActive -public class FluidInletOutletComponent implements Component { +public class FluidInletOutletComponent implements Component { /** The maximum amount of liquid that can flow into the container, in litres (thousandths of a block) per second. */ public float inletRate; /** The maximum amount of liquid that can flow from the container, in litres (thousandths of a block) per second. */ @@ -30,4 +17,12 @@ public class FluidInletOutletComponent implements Component { public float inletVolume; public float outletVolume; + + @Override + public void copyFrom(FluidInletOutletComponent other) { + this.inletRate = other.inletRate; + this.outletRate = other.outletRate; + this.inletVolume = other.inletVolume; + this.outletVolume = other.outletVolume; + } } diff --git a/src/main/java/org/terasology/fluidTransport/components/FluidPipeComponent.java b/src/main/java/org/terasology/fluidTransport/components/FluidPipeComponent.java index a40014e..11a486e 100644 --- a/src/main/java/org/terasology/fluidTransport/components/FluidPipeComponent.java +++ b/src/main/java/org/terasology/fluidTransport/components/FluidPipeComponent.java @@ -1,22 +1,14 @@ -/* - * Copyright 2014 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.fluidTransport.components; -import org.terasology.engine.entitySystem.Component; +import org.terasology.gestalt.entitysystem.component.Component; -public class FluidPipeComponent implements Component { +public class FluidPipeComponent implements Component { public float maximumFlowRate; + + @Override + public void copyFrom(FluidPipeComponent other) { + this.maximumFlowRate = other.maximumFlowRate; + } } diff --git a/src/main/java/org/terasology/fluidTransport/components/FluidPumpComponent.java b/src/main/java/org/terasology/fluidTransport/components/FluidPumpComponent.java index 54c29ca..057198f 100644 --- a/src/main/java/org/terasology/fluidTransport/components/FluidPumpComponent.java +++ b/src/main/java/org/terasology/fluidTransport/components/FluidPumpComponent.java @@ -1,27 +1,20 @@ -/* - * Copyright 2014 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.fluidTransport.components; -import org.terasology.engine.entitySystem.Component; import org.terasology.engine.network.Replicate; import org.terasology.engine.world.block.ForceBlockActive; +import org.terasology.gestalt.entitysystem.component.Component; @ForceBlockActive -public class FluidPumpComponent implements Component { +public class FluidPumpComponent implements Component { @Replicate public float pressure; public float maximumFlowRate; + + @Override + public void copyFrom(FluidPumpComponent other) { + this.pressure = other.pressure; + this.maximumFlowRate = other.maximumFlowRate; + } } diff --git a/src/main/java/org/terasology/fluidTransport/components/FluidTankDisplayComponent.java b/src/main/java/org/terasology/fluidTransport/components/FluidTankDisplayComponent.java index 2dc879d..18399c9 100644 --- a/src/main/java/org/terasology/fluidTransport/components/FluidTankDisplayComponent.java +++ b/src/main/java/org/terasology/fluidTransport/components/FluidTankDisplayComponent.java @@ -1,21 +1,12 @@ -/* - * Copyright 2014 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.fluidTransport.components; -import org.terasology.engine.entitySystem.Component; +import org.terasology.gestalt.entitysystem.component.Component; -public class FluidTankDisplayComponent implements Component { +public class FluidTankDisplayComponent implements Component { + @Override + public void copyFrom(FluidTankDisplayComponent other) { + + } } diff --git a/src/main/java/org/terasology/fluidTransport/components/FluidTankDropsFluidComponent.java b/src/main/java/org/terasology/fluidTransport/components/FluidTankDropsFluidComponent.java index 31d9a71..80b2b19 100644 --- a/src/main/java/org/terasology/fluidTransport/components/FluidTankDropsFluidComponent.java +++ b/src/main/java/org/terasology/fluidTransport/components/FluidTankDropsFluidComponent.java @@ -1,21 +1,12 @@ -/* - * Copyright 2015 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.fluidTransport.components; -import org.terasology.engine.entitySystem.Component; +import org.terasology.gestalt.entitysystem.component.Component; -public class FluidTankDropsFluidComponent implements Component { +public class FluidTankDropsFluidComponent implements Component { + @Override + public void copyFrom(FluidTankDropsFluidComponent other) { + + } } diff --git a/src/main/java/org/terasology/fluidTransport/components/FluidTransportBlockNetworkComponent.java b/src/main/java/org/terasology/fluidTransport/components/FluidTransportBlockNetworkComponent.java index b2fabde..24cc854 100644 --- a/src/main/java/org/terasology/fluidTransport/components/FluidTransportBlockNetworkComponent.java +++ b/src/main/java/org/terasology/fluidTransport/components/FluidTransportBlockNetworkComponent.java @@ -1,27 +1,14 @@ -/* - * Copyright 2014 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.fluidTransport.components; -import org.terasology.engine.entitySystem.Component; import org.terasology.engine.world.block.ForceBlockActive; import org.terasology.entityNetwork.components.BlockLocationNetworkNodeComponent; import org.terasology.fluidTransport.systems.FluidTransportAuthoritySystem; +import org.terasology.gestalt.entitysystem.component.Component; @ForceBlockActive -public class FluidTransportBlockNetworkComponent extends BlockLocationNetworkNodeComponent implements Component { +public class FluidTransportBlockNetworkComponent extends BlockLocationNetworkNodeComponent implements Component { public FluidTransportBlockNetworkComponent() { this.networkId = FluidTransportAuthoritySystem.NETWORK_ID; } diff --git a/src/main/java/org/terasology/fluidTransport/processParts/MechanicalPowerToPressureComponent.java b/src/main/java/org/terasology/fluidTransport/processParts/MechanicalPowerToPressureComponent.java index 672860e..c0fb1ae 100644 --- a/src/main/java/org/terasology/fluidTransport/processParts/MechanicalPowerToPressureComponent.java +++ b/src/main/java/org/terasology/fluidTransport/processParts/MechanicalPowerToPressureComponent.java @@ -1,21 +1,12 @@ -/* - * Copyright 2014 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.fluidTransport.processParts; -import org.terasology.engine.entitySystem.Component; +import org.terasology.gestalt.entitysystem.component.Component; -public class MechanicalPowerToPressureComponent implements Component { +public class MechanicalPowerToPressureComponent implements Component { + @Override + public void copyFrom(MechanicalPowerToPressureComponent other) { + + } } diff --git a/src/main/java/org/terasology/itemTransport/components/PullInventoryInDirectionComponent.java b/src/main/java/org/terasology/itemTransport/components/PullInventoryInDirectionComponent.java index d70e36c..8a562bd 100644 --- a/src/main/java/org/terasology/itemTransport/components/PullInventoryInDirectionComponent.java +++ b/src/main/java/org/terasology/itemTransport/components/PullInventoryInDirectionComponent.java @@ -1,23 +1,15 @@ -/* - * Copyright 2014 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.itemTransport.components; -import org.terasology.engine.entitySystem.Component; import org.terasology.engine.math.Direction; +import org.terasology.gestalt.entitysystem.component.Component; -public class PullInventoryInDirectionComponent implements Component { +public class PullInventoryInDirectionComponent implements Component { public Direction direction = Direction.FORWARD; + + @Override + public void copyFrom(PullInventoryInDirectionComponent other) { + this.direction = other.direction; + } } diff --git a/src/main/java/org/terasology/itemTransport/components/PushInventoryInDirectionComponent.java b/src/main/java/org/terasology/itemTransport/components/PushInventoryInDirectionComponent.java index 89e2f83..68f9152 100644 --- a/src/main/java/org/terasology/itemTransport/components/PushInventoryInDirectionComponent.java +++ b/src/main/java/org/terasology/itemTransport/components/PushInventoryInDirectionComponent.java @@ -1,24 +1,11 @@ -/* - * Copyright 2014 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.itemTransport.components; -import org.terasology.engine.entitySystem.Component; import org.terasology.engine.math.Direction; +import org.terasology.gestalt.entitysystem.component.Component; -public class PushInventoryInDirectionComponent implements Component { +public class PushInventoryInDirectionComponent implements Component { public Direction direction = Direction.BACKWARD; public boolean animateMovingItem; public long timeToDestination = 2000; @@ -27,4 +14,12 @@ public class PushInventoryInDirectionComponent implements Component { public PushInventoryInDirectionComponent() { } + + @Override + public void copyFrom(PushInventoryInDirectionComponent other) { + this.direction = other.direction; + this.animateMovingItem = other.animateMovingItem; + this.timeToDestination = other.timeToDestination; + this.pushFinishTime = other.pushFinishTime; + } } diff --git a/src/main/java/org/terasology/machines/components/MachineDefinitionComponent.java b/src/main/java/org/terasology/machines/components/MachineDefinitionComponent.java index 3635f74..57a72e5 100644 --- a/src/main/java/org/terasology/machines/components/MachineDefinitionComponent.java +++ b/src/main/java/org/terasology/machines/components/MachineDefinitionComponent.java @@ -1,30 +1,17 @@ -/* - * Copyright 2013 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.machines.components; import com.google.common.collect.Lists; import com.google.common.collect.Sets; -import org.terasology.engine.entitySystem.Component; import org.terasology.engine.world.block.ForceBlockActive; +import org.terasology.gestalt.entitysystem.component.Component; import java.util.List; import java.util.Set; @ForceBlockActive -public class MachineDefinitionComponent implements Component { +public class MachineDefinitionComponent implements Component { public int inputSlots; public String inputSlotsTitle = "Input"; public int requirementSlots; @@ -36,4 +23,19 @@ public class MachineDefinitionComponent implements Component { public Set inputWidgets = Sets.newHashSet(); public List fluidInputSlotVolumes = Lists.newLinkedList(); public List fluidOutputSlotVolumes = Lists.newLinkedList(); + + @Override + public void copyFrom(MachineDefinitionComponent other) { + this.inputSlots = other.inputSlots; + this.inputSlotsTitle = other.inputSlotsTitle; + this.requirementSlots = other.requirementSlots; + this.requirementSlotsTitle = other.requirementSlotsTitle; + this.outputSlots = other.outputSlots; + this.outputSlotsTitle = other.outputSlotsTitle; + this.actionTitle = other.actionTitle; + this.outputWidgets = Sets.newHashSet(other.outputWidgets); + this.inputWidgets = Sets.newHashSet(other.inputWidgets); + this.fluidInputSlotVolumes = Lists.newLinkedList(other.fluidInputSlotVolumes); + this.fluidOutputSlotVolumes = Lists.newLinkedList(other.fluidOutputSlotVolumes); + } } diff --git a/src/main/java/org/terasology/machines/components/NestedMachineComponent.java b/src/main/java/org/terasology/machines/components/NestedMachineComponent.java index c319d8e..0e97fe8 100644 --- a/src/main/java/org/terasology/machines/components/NestedMachineComponent.java +++ b/src/main/java/org/terasology/machines/components/NestedMachineComponent.java @@ -1,21 +1,12 @@ -/* - * Copyright 2014 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.machines.components; -import org.terasology.engine.entitySystem.Component; +import org.terasology.gestalt.entitysystem.component.Component; -public class NestedMachineComponent implements Component { +public class NestedMachineComponent implements Component { + @Override + public void copyFrom(NestedMachineComponent other) { + + } } diff --git a/src/main/java/org/terasology/machines/components/ProcessRequirementsProviderComponent.java b/src/main/java/org/terasology/machines/components/ProcessRequirementsProviderComponent.java index 32e62ee..e2c274e 100644 --- a/src/main/java/org/terasology/machines/components/ProcessRequirementsProviderComponent.java +++ b/src/main/java/org/terasology/machines/components/ProcessRequirementsProviderComponent.java @@ -1,37 +1,22 @@ -/* - * Copyright 2013 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.machines.components; import com.google.common.collect.Lists; -import org.terasology.engine.entitySystem.Component; import org.terasology.engine.network.Replicate; +import org.terasology.gestalt.entitysystem.component.Component; import java.util.List; -public class ProcessRequirementsProviderComponent implements Component { +public class ProcessRequirementsProviderComponent implements Component { @Replicate public List requirements = Lists.newArrayList(); public ProcessRequirementsProviderComponent() { } - - public ProcessRequirementsProviderComponent(String... requirements) { - for (String requirement : requirements) { - this.requirements.add(requirement); - } + @Override + public void copyFrom(ProcessRequirementsProviderComponent other) { + this.requirements = Lists.newArrayList(other.requirements); } } diff --git a/src/main/java/org/terasology/machines/components/ProcessRequirementsProviderFromWorkstationComponent.java b/src/main/java/org/terasology/machines/components/ProcessRequirementsProviderFromWorkstationComponent.java index e58bb4e..19c190b 100644 --- a/src/main/java/org/terasology/machines/components/ProcessRequirementsProviderFromWorkstationComponent.java +++ b/src/main/java/org/terasology/machines/components/ProcessRequirementsProviderFromWorkstationComponent.java @@ -1,40 +1,27 @@ -/* - * Copyright 2015 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.machines.components; import com.google.common.collect.Lists; -import org.terasology.engine.entitySystem.Component; import org.terasology.engine.network.Replicate; import org.terasology.engine.world.block.ForceBlockActive; +import org.terasology.gestalt.entitysystem.component.Component; import java.util.List; @ForceBlockActive -public class ProcessRequirementsProviderFromWorkstationComponent implements Component { +public class ProcessRequirementsProviderFromWorkstationComponent implements Component { + + public ProcessRequirementsProviderFromWorkstationComponent() { + } @Replicate public List requirements = Lists.newArrayList(); - public ProcessRequirementsProviderFromWorkstationComponent() { - } - public ProcessRequirementsProviderFromWorkstationComponent(String... requirements) { - for (String requirement : requirements) { - this.requirements.add(requirement); - } - } + @Override + public void copyFrom(ProcessRequirementsProviderFromWorkstationComponent other) { + this.requirements = Lists.newArrayList(other.requirements); + } } diff --git a/src/main/java/org/terasology/machines/components/RenderInventoryInCategoryComponent.java b/src/main/java/org/terasology/machines/components/RenderInventoryInCategoryComponent.java index 5c06e3b..102a413 100644 --- a/src/main/java/org/terasology/machines/components/RenderInventoryInCategoryComponent.java +++ b/src/main/java/org/terasology/machines/components/RenderInventoryInCategoryComponent.java @@ -1,28 +1,21 @@ -/* - * Copyright 2015 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.machines.components; -import org.terasology.engine.entitySystem.Component; +import org.terasology.gestalt.entitysystem.component.Component; import org.terasology.itemRendering.systems.RenderOwnedEntityDetails; /** * Add this to a block that you want items displayed from an inventory category. * Also add the RenderItemComponent to adjust the location of the item, otherwise it will be in the center of the containing block. */ -public class RenderInventoryInCategoryComponent extends RenderOwnedEntityDetails implements Component { +public class RenderInventoryInCategoryComponent extends RenderOwnedEntityDetails implements Component { public String category; public boolean isOutputCategory; + + @Override + public void copyFrom(RenderInventoryInCategoryComponent other) { + this.category = other.category; + this.isOutputCategory = other.isOutputCategory; + } } diff --git a/src/main/java/org/terasology/machines/components/SideActivatedInventoryInteractionComponent.java b/src/main/java/org/terasology/machines/components/SideActivatedInventoryInteractionComponent.java index 169f475..b3477cd 100644 --- a/src/main/java/org/terasology/machines/components/SideActivatedInventoryInteractionComponent.java +++ b/src/main/java/org/terasology/machines/components/SideActivatedInventoryInteractionComponent.java @@ -1,27 +1,22 @@ -/* - * Copyright 2015 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.machines.components; -import org.terasology.engine.entitySystem.Component; +import org.terasology.gestalt.entitysystem.component.Component; -public class SideActivatedInventoryInteractionComponent implements Component { +public class SideActivatedInventoryInteractionComponent implements Component { public String direction; public String inputType; public Boolean inputIsOutputType; public String outputType; public Boolean outputIsOutputType; + @Override + public void copyFrom(SideActivatedInventoryInteractionComponent other) { + this.direction = other.direction; + this.inputType = other.inputType; + this.inputIsOutputType = other.inputIsOutputType; + this.outputType = other.outputType; + this.outputIsOutputType = other.outputIsOutputType; + } } diff --git a/src/main/java/org/terasology/machines/processParts/RequirementInputComponent.java b/src/main/java/org/terasology/machines/processParts/RequirementInputComponent.java index f94fb80..d799379 100644 --- a/src/main/java/org/terasology/machines/processParts/RequirementInputComponent.java +++ b/src/main/java/org/terasology/machines/processParts/RequirementInputComponent.java @@ -1,25 +1,18 @@ -/* - * Copyright 2013 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.machines.processParts; import com.google.common.collect.Lists; -import org.terasology.engine.entitySystem.Component; +import org.terasology.gestalt.entitysystem.component.Component; import java.util.List; -public class RequirementInputComponent implements Component { +public class RequirementInputComponent implements Component { public List requirements = Lists.newArrayList(); + + @Override + public void copyFrom(RequirementInputComponent other) { + this.requirements.clear(); + this.requirements.addAll(other.requirements); + } } diff --git a/src/main/java/org/terasology/mechanicalPower/components/MechanicalPowerBlockNetworkComponent.java b/src/main/java/org/terasology/mechanicalPower/components/MechanicalPowerBlockNetworkComponent.java index 7e26816..26ae3e9 100644 --- a/src/main/java/org/terasology/mechanicalPower/components/MechanicalPowerBlockNetworkComponent.java +++ b/src/main/java/org/terasology/mechanicalPower/components/MechanicalPowerBlockNetworkComponent.java @@ -1,27 +1,14 @@ -/* - * Copyright 2014 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.mechanicalPower.components; -import org.terasology.engine.entitySystem.Component; import org.terasology.engine.world.block.ForceBlockActive; import org.terasology.entityNetwork.components.BlockLocationNetworkNodeComponent; +import org.terasology.gestalt.entitysystem.component.Component; import org.terasology.mechanicalPower.systems.MechanicalPowerAuthoritySystem; @ForceBlockActive -public class MechanicalPowerBlockNetworkComponent extends BlockLocationNetworkNodeComponent implements Component { +public class MechanicalPowerBlockNetworkComponent extends BlockLocationNetworkNodeComponent implements Component { public MechanicalPowerBlockNetworkComponent() { networkId = MechanicalPowerAuthoritySystem.NETWORK_ID; } diff --git a/src/main/java/org/terasology/mechanicalPower/components/MechanicalPowerProducerComponent.java b/src/main/java/org/terasology/mechanicalPower/components/MechanicalPowerProducerComponent.java index 9ee6ce6..d7778f6 100644 --- a/src/main/java/org/terasology/mechanicalPower/components/MechanicalPowerProducerComponent.java +++ b/src/main/java/org/terasology/mechanicalPower/components/MechanicalPowerProducerComponent.java @@ -1,28 +1,21 @@ -/* - * Copyright 2014 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.mechanicalPower.components; -import org.terasology.engine.entitySystem.Component; import org.terasology.engine.network.Replicate; import org.terasology.engine.world.block.ForceBlockActive; +import org.terasology.gestalt.entitysystem.component.Component; @ForceBlockActive -public class MechanicalPowerProducerComponent implements Component { +public class MechanicalPowerProducerComponent implements Component { @Replicate public float power; @Replicate public boolean active; + + @Override + public void copyFrom(MechanicalPowerProducerComponent other) { + this.power = other.power; + this.active = other.active; + } } diff --git a/src/main/java/org/terasology/mechanicalPower/components/MechanicalPowerRegenComponent.java b/src/main/java/org/terasology/mechanicalPower/components/MechanicalPowerRegenComponent.java index ed8ef87..49e86e4 100644 --- a/src/main/java/org/terasology/mechanicalPower/components/MechanicalPowerRegenComponent.java +++ b/src/main/java/org/terasology/mechanicalPower/components/MechanicalPowerRegenComponent.java @@ -1,24 +1,16 @@ -/* - * Copyright 2014 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.mechanicalPower.components; -import org.terasology.engine.entitySystem.Component; import org.terasology.engine.network.Replicate; +import org.terasology.gestalt.entitysystem.component.Component; -public class MechanicalPowerRegenComponent implements Component { +public class MechanicalPowerRegenComponent implements Component { @Replicate public float power; + + @Override + public void copyFrom(MechanicalPowerRegenComponent other) { + this.power = other.power; + } } diff --git a/src/main/java/org/terasology/mechanicalPower/components/MechanicalPowerSidedBlockNetworkComponent.java b/src/main/java/org/terasology/mechanicalPower/components/MechanicalPowerSidedBlockNetworkComponent.java index 3641496..ade0fc5 100644 --- a/src/main/java/org/terasology/mechanicalPower/components/MechanicalPowerSidedBlockNetworkComponent.java +++ b/src/main/java/org/terasology/mechanicalPower/components/MechanicalPowerSidedBlockNetworkComponent.java @@ -1,27 +1,15 @@ -/* - * Copyright 2015 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.mechanicalPower.components; -import org.terasology.engine.entitySystem.Component; import org.terasology.engine.world.block.ForceBlockActive; +import org.terasology.entityNetwork.components.BlockLocationNetworkNodeComponent; import org.terasology.entityNetwork.components.SidedBlockLocationNetworkNodeComponent; +import org.terasology.gestalt.entitysystem.component.Component; import org.terasology.mechanicalPower.systems.MechanicalPowerAuthoritySystem; @ForceBlockActive -public class MechanicalPowerSidedBlockNetworkComponent extends SidedBlockLocationNetworkNodeComponent implements Component { +public class MechanicalPowerSidedBlockNetworkComponent extends SidedBlockLocationNetworkNodeComponent implements Component { public MechanicalPowerSidedBlockNetworkComponent() { networkId = MechanicalPowerAuthoritySystem.NETWORK_ID; } diff --git a/src/main/java/org/terasology/mechanicalPower/components/RotatingAxleComponent.java b/src/main/java/org/terasology/mechanicalPower/components/RotatingAxleComponent.java index 2e5c6e7..524bedd 100644 --- a/src/main/java/org/terasology/mechanicalPower/components/RotatingAxleComponent.java +++ b/src/main/java/org/terasology/mechanicalPower/components/RotatingAxleComponent.java @@ -1,25 +1,17 @@ -/* - * Copyright 2014 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.mechanicalPower.components; -import org.terasology.engine.entitySystem.Component; import org.terasology.engine.entitySystem.Owns; import org.terasology.engine.entitySystem.entity.EntityRef; +import org.terasology.gestalt.entitysystem.component.Component; -public class RotatingAxleComponent implements Component { +public class RotatingAxleComponent implements Component { @Owns public EntityRef renderedEntity; + + @Override + public void copyFrom(RotatingAxleComponent other) { + this.renderedEntity = other.renderedEntity; + } } diff --git a/src/main/java/org/terasology/mechanicalPower/processParts/ActivateEngineOutputComponent.java b/src/main/java/org/terasology/mechanicalPower/processParts/ActivateEngineOutputComponent.java index 8ad4870..17f50eb 100644 --- a/src/main/java/org/terasology/mechanicalPower/processParts/ActivateEngineOutputComponent.java +++ b/src/main/java/org/terasology/mechanicalPower/processParts/ActivateEngineOutputComponent.java @@ -1,22 +1,14 @@ -/* - * Copyright 2014 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.mechanicalPower.processParts; -import org.terasology.engine.entitySystem.Component; +import org.terasology.gestalt.entitysystem.component.Component; -public class ActivateEngineOutputComponent implements Component { +public class ActivateEngineOutputComponent implements Component { public long activateTime; + + @Override + public void copyFrom(ActivateEngineOutputComponent other) { + this.activateTime = other.activateTime; + } } diff --git a/src/main/java/org/terasology/mechanicalPower/processParts/ActivateEngineOutputProcessPartCommonSystem.java b/src/main/java/org/terasology/mechanicalPower/processParts/ActivateEngineOutputProcessPartCommonSystem.java index 9065fb0..9751eb0 100644 --- a/src/main/java/org/terasology/mechanicalPower/processParts/ActivateEngineOutputProcessPartCommonSystem.java +++ b/src/main/java/org/terasology/mechanicalPower/processParts/ActivateEngineOutputProcessPartCommonSystem.java @@ -1,18 +1,5 @@ -/* - * Copyright 2016 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.mechanicalPower.processParts; import org.terasology.engine.entitySystem.entity.EntityRef; diff --git a/src/main/java/org/terasology/mechanicalPower/processParts/MechanicalPowerInputComponent.java b/src/main/java/org/terasology/mechanicalPower/processParts/MechanicalPowerInputComponent.java index cc26771..3c8bec8 100644 --- a/src/main/java/org/terasology/mechanicalPower/processParts/MechanicalPowerInputComponent.java +++ b/src/main/java/org/terasology/mechanicalPower/processParts/MechanicalPowerInputComponent.java @@ -1,22 +1,14 @@ -/* - * Copyright 2014 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.mechanicalPower.processParts; -import org.terasology.engine.entitySystem.Component; +import org.terasology.gestalt.entitysystem.component.Component; -public class MechanicalPowerInputComponent implements Component { +public class MechanicalPowerInputComponent implements Component { public float power; + + @Override + public void copyFrom(MechanicalPowerInputComponent other) { + this.power = other.power; + } } diff --git a/src/main/java/org/terasology/mechanicalPower/processParts/MechanicalPowerInputProcessPartCommonSystem.java b/src/main/java/org/terasology/mechanicalPower/processParts/MechanicalPowerInputProcessPartCommonSystem.java index 092c2a6..b177dc0 100644 --- a/src/main/java/org/terasology/mechanicalPower/processParts/MechanicalPowerInputProcessPartCommonSystem.java +++ b/src/main/java/org/terasology/mechanicalPower/processParts/MechanicalPowerInputProcessPartCommonSystem.java @@ -1,18 +1,5 @@ -/* - * Copyright 2016 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.mechanicalPower.processParts; import org.terasology.engine.entitySystem.entity.EntityRef;