[1.18] Integrate the gametest framework with Forge (#8225)

Signed-off-by: SizableShrimp <[email protected]>
This commit is contained in:
SizableShrimp authored and GitHub committed 2022-02-25 01:06:32 +00:00
1 parent bb547a5748
commit f0c2554b1c
28 files changed
+944 -8

No files matched your search

@@ -0,0 +1,45 @@
/*
* Minecraft Forge
* Copyright (c) 2016-2021.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package net.minecraftforge.gametest;
import joptsimple.ValueConverter;
import net.minecraft.core.BlockPos;
public class BlockPosValueConverter implements ValueConverter<BlockPos>
{
@Override
public BlockPos convert(String value)
{
String[] split = value.split(",");
return new BlockPos(Double.parseDouble(split[0]), Double.parseDouble(split[1]), Double.parseDouble(split[2]));
}
@Override
public Class<BlockPos> valueType()
{
return BlockPos.class;
}
@Override
public String valuePattern()
{
return null;
}
}