Remove everything related to depreciated digital & quantum chest + tank

This commit is contained in:
Justin Vitale 2020-06-19 22:37:44 +10:00
parent f6e632f9d6
commit c0f1e50ecd
37 changed files with 0 additions and 526 deletions

View file

@ -1,65 +0,0 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2020 TechReborn
*
* 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 the 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 techreborn.blockentity.storage.fluid;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.common.util.Tank;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
@Deprecated
public class CreativeQuantumTankBlockEntity extends TankUnitBaseBlockEntity {
// Save
public CreativeQuantumTankBlockEntity() {
super(TRBlockEntities.CREATIVE_QUANTUM_TANK, TRContent.TankUnit.QUANTUM);
}
@Override
public void onBreak(World world, PlayerEntity playerEntity, BlockPos blockPos, BlockState blockState) {
inventory.clear();
}
@Override
public void tick() {
if (world.isClient()) {
return;
}
Tank tank = this.getTank();
inventory.clear();
world.setBlockState(pos, TRContent.TankUnit.CREATIVE.block.getDefaultState());
TankUnitBaseBlockEntity tankEntity = (TankUnitBaseBlockEntity) world.getBlockEntity(pos);
tankEntity.setTank(tank);
}
}

View file

@ -1,75 +0,0 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2020 TechReborn
*
* 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 the 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 techreborn.blockentity.storage.fluid;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.common.util.Tank;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
@Deprecated
public class QuantumTankBlockEntity extends TankUnitBaseBlockEntity {
// Save
public QuantumTankBlockEntity() {
super(TRBlockEntities.QUANTUM_TANK, TRContent.TankUnit.QUANTUM);
}
@Override
public void onBreak(World world, PlayerEntity playerEntity, BlockPos blockPos, BlockState blockState) {
inventory.clear();
}
@Override
public void tick() {
if (world.isClient()) {
return;
}
Tank tank = this.getTank();
ItemStack inputSlotStack = getStack(0).copy();
ItemStack outputSlotStack = getStack(1).copy();
inventory.clear();
world.setBlockState(pos, TRContent.TankUnit.QUANTUM.block.getDefaultState());
TankUnitBaseBlockEntity tankEntity = (TankUnitBaseBlockEntity) world.getBlockEntity(pos);
if (tankEntity == null) {
return;
}
tankEntity.setTank(tank);
tankEntity.setStack(0, inputSlotStack);
tankEntity.setStack(1, outputSlotStack);
}
}

View file

@ -67,12 +67,6 @@ public class TankUnitBaseBlockEntity extends MachineBaseBlockEntity implements I
configureEntity(type);
}
public TankUnitBaseBlockEntity(BlockEntityType<?> blockEntityTypeIn, TRContent.TankUnit type) {
super(blockEntityTypeIn);
this.type = type;
}
private void configureEntity(TRContent.TankUnit type) {
this.type = type;
this.tank = new Tank("TankStorage", type.capacity, this);
@ -110,20 +104,7 @@ public class TankUnitBaseBlockEntity extends MachineBaseBlockEntity implements I
this.type = TRContent.TankUnit.valueOf(tagCompound.getString("unitType"));
configureEntity(type);
tank.read(tagCompound);
} else {
// SAVE COMPAT
if (tagCompound.contains("QuantumTankBlockEntity")) {
this.type = TRContent.TankUnit.QUANTUM;
Tank temp = new Tank("QuantumTankBlockEntity", type.capacity, this);
temp.read(tagCompound);
// Set tank name to what it should be
tank = new Tank("TankStorage", type.capacity, this);
tank.setFluid(null, temp.getFluidInstance().copy());
}
}
}
@Override

View file

@ -1,65 +0,0 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2020 TechReborn
*
* 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 the 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 techreborn.blockentity.storage.item;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
@Deprecated
public class CreativeQuantumChestBlockEntity extends StorageUnitBaseBlockEntity {
public CreativeQuantumChestBlockEntity() {
super(TRBlockEntities.CREATIVE_QUANTUM_CHEST, "QuantumChestBlockEntity", Integer.MAX_VALUE);
}
@Override
public void onBreak(World world, PlayerEntity playerEntity, BlockPos blockPos, BlockState blockState) {
super.inventory.clear();
}
@Override
public void tick() {
if (world.isClient()) {
return;
}
ItemStack storedStack = this.getAll();
this.clear();
world.setBlockState(pos, TRContent.StorageUnit.CREATIVE.block.getDefaultState());
StorageUnitBaseBlockEntity storageEntity = (StorageUnitBaseBlockEntity) world.getBlockEntity(pos);
if (!storedStack.isEmpty() && storageEntity != null) {
storageEntity.setStoredStack(storedStack);
}
}
}

View file

@ -1,67 +0,0 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2020 TechReborn
*
* 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 the 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 techreborn.blockentity.storage.item;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
@Deprecated
public class DigitalChestBlockEntity extends StorageUnitBaseBlockEntity {
public DigitalChestBlockEntity() {
super(TRBlockEntities.DIGITAL_CHEST, "DigitalChestBlockEntity", 32768);
}
@Override
public void onBreak(World world, PlayerEntity playerEntity, BlockPos blockPos, BlockState blockState) {
super.inventory.clear();
}
@Override
public void tick() {
if (world.isClient()) {
return;
}
ItemStack storedStack = this.getAll();
ItemStack inputSlotStack = this.getStack(0).copy();
this.clear();
world.setBlockState(pos, TRContent.StorageUnit.INDUSTRIAL.block.getDefaultState());
StorageUnitBaseBlockEntity storageEntity = (StorageUnitBaseBlockEntity) world.getBlockEntity(pos);
if (!storedStack.isEmpty() && storageEntity != null) {
storageEntity.setStoredStack(storedStack);
storageEntity.setStack(0, inputSlotStack);
}
}
}

View file

@ -1,68 +0,0 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2020 TechReborn
*
* 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 the 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 techreborn.blockentity.storage.item;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
@Deprecated
public class QuantumChestBlockEntity extends StorageUnitBaseBlockEntity {
public QuantumChestBlockEntity() {
super(TRBlockEntities.QUANTUM_CHEST, "QuantumChestBlockEntity", Integer.MAX_VALUE);
}
@Override
public void onBreak(World world, PlayerEntity playerEntity, BlockPos blockPos, BlockState blockState) {
super.inventory.clear();
super.onBreak(world, playerEntity, blockPos, blockState);
}
@Override
public void tick() {
if (world.isClient()) {
return;
}
ItemStack storedStack = this.getAll();
ItemStack inputSlotStack = this.getStack(0).copy();
this.clear();
world.setBlockState(pos, TRContent.StorageUnit.QUANTUM.block.getDefaultState());
StorageUnitBaseBlockEntity storageEntity = (StorageUnitBaseBlockEntity) world.getBlockEntity(pos);
if (!storedStack.isEmpty() && storageEntity != null) {
storageEntity.setStoredStack(storedStack);
storageEntity.setStack(0, inputSlotStack);
}
}
}

View file

@ -80,15 +80,6 @@ public class StorageUnitBaseBlockEntity extends MachineBaseBlockEntity
configureEntity(type);
}
@Deprecated
public StorageUnitBaseBlockEntity(BlockEntityType<?> blockEntityTypeIn, String name, int maxCapacity) {
super(blockEntityTypeIn);
this.maxCapacity = maxCapacity;
storeItemStack = ItemStack.EMPTY;
type = TRContent.StorageUnit.QUANTUM;
inventory = new RebornInventory<>(3, name, maxCapacity, this);
}
private void configureEntity(TRContent.StorageUnit type) {
this.maxCapacity = type.capacity;
storeItemStack = ItemStack.EMPTY;