forked from PaperMC/DataConverter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
359 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3938.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package ca.spottedleaf.dataconverter.minecraft.versions; | ||
|
||
import ca.spottedleaf.dataconverter.minecraft.MCVersions; | ||
import ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry; | ||
import ca.spottedleaf.dataconverter.minecraft.walkers.generic.DataWalkerTypePaths; | ||
import ca.spottedleaf.dataconverter.minecraft.walkers.itemstack.DataWalkerItems; | ||
|
||
public final class V3938 { | ||
|
||
private static final int VERSION = MCVersions.V1_20_6 + 99; | ||
|
||
private static void registerArrow(final String id) { | ||
MCTypeRegistry.ENTITY.addWalker(VERSION, id, new DataWalkerTypePaths<>(MCTypeRegistry.BLOCK_STATE, "inBlockState")); | ||
// new: weapon | ||
MCTypeRegistry.ENTITY.addWalker(VERSION, id, new DataWalkerItems("item", "weapon")); | ||
} | ||
|
||
public static void register() { | ||
registerArrow("minecraft:spectral_arrow"); | ||
registerArrow("minecraft:arrow"); | ||
} | ||
|
||
private V3938() {} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3939.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package ca.spottedleaf.dataconverter.minecraft.versions; | ||
|
||
import ca.spottedleaf.dataconverter.minecraft.MCVersions; | ||
import ca.spottedleaf.dataconverter.minecraft.converters.leveldat.ConverterRemoveFeatureFlag; | ||
import ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry; | ||
import java.util.Arrays; | ||
import java.util.HashSet; | ||
|
||
public final class V3939 { | ||
|
||
private static final int VERSION = MCVersions.V1_20_6 + 100; | ||
|
||
public static void register() { | ||
MCTypeRegistry.LEVEL.addStructureConverter(new ConverterRemoveFeatureFlag(VERSION, new HashSet<>( | ||
Arrays.asList( | ||
"minecraft:update_1_21" | ||
) | ||
))); | ||
} | ||
|
||
private V3939() {} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3943.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package ca.spottedleaf.dataconverter.minecraft.versions; | ||
|
||
import ca.spottedleaf.dataconverter.converters.DataConverter; | ||
import ca.spottedleaf.dataconverter.minecraft.MCVersions; | ||
import ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry; | ||
import ca.spottedleaf.dataconverter.types.MapType; | ||
|
||
public final class V3943 { | ||
|
||
private static final int VERSION = MCVersions.V2419WB + 1; | ||
|
||
public static void register() { | ||
MCTypeRegistry.OPTIONS.addStructureConverter(new DataConverter<>(VERSION) { | ||
@Override | ||
public MapType<String> convert(final MapType<String> data, final long sourceVersion, final long toVersion) { | ||
final String oldRange = data.getString("menuBackgroundBlurriness", "0.5"); | ||
|
||
int newRange; | ||
try { | ||
newRange = (int)Math.round(Double.parseDouble(oldRange) * 10.0); | ||
} catch (final NumberFormatException ex) { | ||
newRange = 5; | ||
} | ||
|
||
// note: options are always string, so DFU is wrong to use int | ||
data.setString("menuBackgroundBlurriness", Integer.toString(newRange)); | ||
|
||
return null; | ||
} | ||
}); | ||
} | ||
|
||
private V3943() {} | ||
} |
Oops, something went wrong.