Removed color provider
This commit is contained in:
parent
2c8862a37b
commit
4040597a6d
475 changed files with 5411 additions and 7521 deletions
19
Convert.java
19
Convert.java
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
class ModelPart {
|
class ModelPart {
|
||||||
static java.util.ArrayList<ModelPart> parts = new java.util.ArrayList<>(20);
|
static java.util.ArrayList<ModelPart> parts = new java.util.ArrayList<>(20);
|
||||||
final String name;
|
final String name;
|
||||||
|
@ -14,6 +13,7 @@ class ModelPart {
|
||||||
|
|
||||||
|
|
||||||
boolean hadBox = false;
|
boolean hadBox = false;
|
||||||
|
|
||||||
ModelPart(Convert c, String name) {
|
ModelPart(Convert c, String name) {
|
||||||
this(c, 0, 0, name);
|
this(c, 0, 0, name);
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@ class ModelPart {
|
||||||
this.v = v;
|
this.v = v;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
ModelPart addBox(float x, float y, float z, float a, float b, float c) {
|
ModelPart addBox(float x, float y, float z, float a, float b, float c) {
|
||||||
return addBox(x, y, z, a, b, c, 1);
|
return addBox(x, y, z, a, b, c, 1);
|
||||||
}
|
}
|
||||||
|
@ -74,6 +75,7 @@ class ModelPart {
|
||||||
hadBox = true;
|
hadBox = true;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
ModelPart addBox(float x, float y, float z, float a, float b, float c, float _d, boolean mirror) {
|
ModelPart addBox(float x, float y, float z, float a, float b, float c, float _d, boolean mirror) {
|
||||||
this.mirror = mirror;
|
this.mirror = mirror;
|
||||||
bx = x;
|
bx = x;
|
||||||
|
@ -100,17 +102,19 @@ class ModelPart {
|
||||||
s += "\n";
|
s += "\n";
|
||||||
if (scale != 1)
|
if (scale != 1)
|
||||||
s += ".addBox(" + bx + "f, " + by + "f, " + bz + "f, " + ba + "f, " + bb + "f, " + bc + "f, deformation_" + name + "),\n";
|
s += ".addBox(" + bx + "f, " + by + "f, " + bz + "f, " + ba + "f, " + bb + "f, " + bc + "f, deformation_" + name + "),\n";
|
||||||
else
|
else s += ".addBox(" + bx + "f, " + by + "f, " + bz + "f, " + ba + "f, " + bb + "f, " + bc + "f),\n";
|
||||||
s+= ".addBox("+bx+"f, "+by+"f, "+bz+"f, "+ba+"f, "+bb+"f, "+bc+"f),\n";
|
}
|
||||||
} else {
|
else {
|
||||||
s += ",\n";
|
s += ",\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x == 0 && y == 0 && z == 0 && rx == 0 && ry == 0 && rz == 0) {
|
if (x == 0 && y == 0 && z == 0 && rx == 0 && ry == 0 && rz == 0) {
|
||||||
s += "PartPose.ZERO";
|
s += "PartPose.ZERO";
|
||||||
} else if (rx==0 && ry==0 && rz==0){
|
}
|
||||||
|
else if (rx == 0 && ry == 0 && rz == 0) {
|
||||||
s += "PartPose.offset(" + x + "f, " + y + "f, " + z + "f)";
|
s += "PartPose.offset(" + x + "f, " + y + "f, " + z + "f)";
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
s += "PartPose.offsetAndRotation(" + x + "f, " + y + "f, " + z + "f, \n" + rx + "f, " + ry + "f, " + rz + "f)";
|
s += "PartPose.offsetAndRotation(" + x + "f, " + y + "f, " + z + "f, \n" + rx + "f, " + ry + "f, " + rz + "f)";
|
||||||
}
|
}
|
||||||
s += ");";
|
s += ");";
|
||||||
|
@ -138,15 +142,18 @@ class ModelPart {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Convert {
|
public class Convert {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
new Convert().c();
|
new Convert().c();
|
||||||
|
|
||||||
ModelPart.print();
|
ModelPart.print();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setRotationAngle(ModelPart p, float x, float y, float z) {
|
void setRotationAngle(ModelPart p, float x, float y, float z) {
|
||||||
p.setRotationAngle(x, y, z);
|
p.setRotationAngle(x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void c() {
|
public void c() {
|
||||||
float scale = 1;
|
float scale = 1;
|
||||||
ModelPart partC = new ModelPart(64, 64, 0, 19, "partC");
|
ModelPart partC = new ModelPart(64, 64, 0, 19, "partC");
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
[](https://jitpack.io/#paulevsGitch/BetterEnd)
|
[](https://jitpack.io/#paulevsGitch/BetterEnd)
|
||||||
|
|
||||||
# Better End
|
# Better End
|
||||||
|
|
||||||
Better End Mod for Fabric, MC 1.17.1
|
Better End Mod for Fabric, MC 1.17.1
|
||||||
|
|
||||||
Importing:
|
Importing:
|
||||||
|
|
||||||
* Clone repo
|
* Clone repo
|
||||||
* Edit gradle.properties if necessary
|
* Edit gradle.properties if necessary
|
||||||
* Run command line in folder: gradlew genSources eclipse (or Another-IDE-Name)
|
* Run command line in folder: gradlew genSources eclipse (or Another-IDE-Name)
|
||||||
* Import project to IDE
|
* Import project to IDE
|
||||||
|
|
||||||
Building:
|
Building:
|
||||||
|
|
||||||
* Clone repo
|
* Clone repo
|
||||||
* Run command line in folder: gradlew build
|
* Run command line in folder: gradlew build
|
||||||
* Mod .jar will be in ./build/libs
|
* Mod .jar will be in ./build/libs
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
# Done to increase the memory available to gradle.
|
# Done to increase the memory available to gradle.
|
||||||
org.gradle.jvmargs=-Xmx2G
|
org.gradle.jvmargs=-Xmx2G
|
||||||
|
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check these on https://fabricmc.net/use
|
# check these on https://fabricmc.net/use
|
||||||
minecraft_version=1.17.1
|
minecraft_version=1.17.1
|
||||||
yarn_mappings=6
|
yarn_mappings=6
|
||||||
loader_version=0.11.6
|
loader_version=0.11.6
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 0.10.2-pre
|
mod_version=0.10.3-pre
|
||||||
maven_group=ru.betterend
|
maven_group=ru.betterend
|
||||||
archives_base_name=better-end
|
archives_base_name=better-end
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
||||||
patchouli_version=55-FABRIC-SNAPSHOT
|
patchouli_version=55-FABRIC-SNAPSHOT
|
||||||
fabric_version=0.36.1+1.17
|
fabric_version=0.36.1+1.17
|
||||||
bclib_version = 0.2.0
|
bclib_version=0.2.1
|
||||||
rei_version=6.0.262-alpha
|
rei_version=6.0.262-alpha
|
||||||
canvas_version=1.0.+
|
canvas_version=1.0.+
|
||||||
|
|
|
@ -1,7 +1,16 @@
|
||||||
{
|
{
|
||||||
"variants": {
|
"variants": {
|
||||||
"axis=x": { "model": "betterend:block/%name%_pillar", "x": 90, "y": 90 },
|
"axis=x": {
|
||||||
"axis=y": { "model": "betterend:block/%name%_pillar" },
|
"model": "betterend:block/%name%_pillar",
|
||||||
"axis=z": { "model": "betterend:block/%name%_pillar", "x": 90 }
|
"x": 90,
|
||||||
|
"y": 90
|
||||||
|
},
|
||||||
|
"axis=y": {
|
||||||
|
"model": "betterend:block/%name%_pillar"
|
||||||
|
},
|
||||||
|
"axis=z": {
|
||||||
|
"model": "betterend:block/%name%_pillar",
|
||||||
|
"x": 90
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -14,11 +14,7 @@ import ru.bclib.blocks.BaseBlock;
|
||||||
public class AeterniumBlock extends BaseBlock {
|
public class AeterniumBlock extends BaseBlock {
|
||||||
|
|
||||||
public AeterniumBlock() {
|
public AeterniumBlock() {
|
||||||
super(FabricBlockSettings.of(Material.METAL, MaterialColor.COLOR_GRAY)
|
super(FabricBlockSettings.of(Material.METAL, MaterialColor.COLOR_GRAY).hardness(65F).resistance(1200F).requiresCorrectToolForDrops().sound(SoundType.NETHERITE_BLOCK));
|
||||||
.hardness(65F)
|
|
||||||
.resistance(1200F)
|
|
||||||
.requiresCorrectToolForDrops()
|
|
||||||
.sound(SoundType.NETHERITE_BLOCK));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
|
|
|
@ -33,15 +33,7 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements IRenderTyp
|
||||||
private static final int MAX_DROP = 4;
|
private static final int MAX_DROP = 4;
|
||||||
|
|
||||||
public AuroraCrystalBlock() {
|
public AuroraCrystalBlock() {
|
||||||
super(FabricBlockSettings.of(Material.GLASS)
|
super(FabricBlockSettings.of(Material.GLASS).breakByTool(FabricToolTags.PICKAXES).breakByTool(TagAPI.HAMMERS).hardness(1F).resistance(1F).luminance(15).noOcclusion().isSuffocating((state, world, pos) -> false).sound(SoundType.GLASS));
|
||||||
.breakByTool(FabricToolTags.PICKAXES)
|
|
||||||
.breakByTool(TagAPI.HAMMERS)
|
|
||||||
.hardness(1F)
|
|
||||||
.resistance(1F)
|
|
||||||
.luminance(15)
|
|
||||||
.noOcclusion()
|
|
||||||
.isSuffocating((state, world, pos) -> false)
|
|
||||||
.sound(SoundType.GLASS));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -109,11 +101,6 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements IRenderTyp
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
COLORS = new Vec3i[]{
|
COLORS = new Vec3i[]{new Vec3i(247, 77, 161), new Vec3i(120, 184, 255), new Vec3i(120, 255, 168), new Vec3i(243, 58, 255)};
|
||||||
new Vec3i(247, 77, 161),
|
|
||||||
new Vec3i(120, 184, 255),
|
|
||||||
new Vec3i(120, 255, 168),
|
|
||||||
new Vec3i(243, 58, 255)
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,10 +87,7 @@ public class BrimstoneBlock extends BaseBlock {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (sideState.getFluidState().getType() == Fluids.WATER) {
|
else if (sideState.getFluidState().getType() == Fluids.WATER) {
|
||||||
BlockState crystal = EndBlocks.SULPHUR_CRYSTAL.defaultBlockState()
|
BlockState crystal = EndBlocks.SULPHUR_CRYSTAL.defaultBlockState().setValue(SulphurCrystalBlock.FACING, dir).setValue(SulphurCrystalBlock.WATERLOGGED, true).setValue(SulphurCrystalBlock.AGE, 0);
|
||||||
.setValue(SulphurCrystalBlock.FACING, dir)
|
|
||||||
.setValue(SulphurCrystalBlock.WATERLOGGED, true)
|
|
||||||
.setValue(SulphurCrystalBlock.AGE, 0);
|
|
||||||
world.setBlockAndUpdate(side, crystal);
|
world.setBlockAndUpdate(side, crystal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,11 +24,7 @@ public class BubbleCoralBlock extends EndUnderwaterPlantBlock {
|
||||||
private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 14, 16);
|
private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 14, 16);
|
||||||
|
|
||||||
public BubbleCoralBlock() {
|
public BubbleCoralBlock() {
|
||||||
super(FabricBlockSettings.of(Material.WATER_PLANT)
|
super(FabricBlockSettings.of(Material.WATER_PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.CORAL_BLOCK).noCollission());
|
||||||
.breakByTool(FabricToolTags.SHEARS)
|
|
||||||
.breakByHand(true)
|
|
||||||
.sound(SoundType.CORAL_BLOCK)
|
|
||||||
.noCollission());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -32,14 +32,7 @@ public class BulbVineLanternBlock extends EndLanternBlock implements IRenderType
|
||||||
private static final VoxelShape SHAPE_FLOOR = Block.box(4, 0, 4, 12, 12, 12);
|
private static final VoxelShape SHAPE_FLOOR = Block.box(4, 0, 4, 12, 12, 12);
|
||||||
|
|
||||||
public BulbVineLanternBlock() {
|
public BulbVineLanternBlock() {
|
||||||
this(FabricBlockSettings.of(Material.METAL)
|
this(FabricBlockSettings.of(Material.METAL).hardness(1).resistance(1).breakByTool(FabricToolTags.PICKAXES).materialColor(MaterialColor.COLOR_LIGHT_GRAY).luminance(15).requiresCorrectToolForDrops().sound(SoundType.LANTERN));
|
||||||
.hardness(1)
|
|
||||||
.resistance(1)
|
|
||||||
.breakByTool(FabricToolTags.PICKAXES)
|
|
||||||
.materialColor(MaterialColor.COLOR_LIGHT_GRAY)
|
|
||||||
.luminance(15)
|
|
||||||
.requiresCorrectToolForDrops()
|
|
||||||
.sound(SoundType.LANTERN));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public BulbVineLanternBlock(Properties settings) {
|
public BulbVineLanternBlock(Properties settings) {
|
||||||
|
@ -62,9 +55,7 @@ public class BulbVineLanternBlock extends EndLanternBlock implements IRenderType
|
||||||
Map<String, String> textures = Maps.newHashMap();
|
Map<String, String> textures = Maps.newHashMap();
|
||||||
textures.put("%glow%", getGlowTexture());
|
textures.put("%glow%", getGlowTexture());
|
||||||
textures.put("%metal%", getMetalTexture(resourceLocation));
|
textures.put("%metal%", getMetalTexture(resourceLocation));
|
||||||
Optional<String> pattern = blockState.getValue(IS_FLOOR) ?
|
Optional<String> pattern = blockState.getValue(IS_FLOOR) ? Patterns.createJson(Patterns.BLOCK_BULB_LANTERN_FLOOR, textures) : Patterns.createJson(Patterns.BLOCK_BULB_LANTERN_CEIL, textures);
|
||||||
Patterns.createJson(Patterns.BLOCK_BULB_LANTERN_FLOOR, textures) :
|
|
||||||
Patterns.createJson(Patterns.BLOCK_BULB_LANTERN_CEIL, textures);
|
|
||||||
return ModelsHelper.fromPattern(pattern);
|
return ModelsHelper.fromPattern(pattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,14 +14,10 @@ public class EndBlockProperties extends BlockProperties {
|
||||||
|
|
||||||
public static final BooleanProperty HAS_ITEM = BooleanProperty.create("has_item");
|
public static final BooleanProperty HAS_ITEM = BooleanProperty.create("has_item");
|
||||||
public static final IntegerProperty PORTAL = IntegerProperty.create("portal", 0, EndPortals.getCount());
|
public static final IntegerProperty PORTAL = IntegerProperty.create("portal", 0, EndPortals.getCount());
|
||||||
|
public static final IntegerProperty PLANT_ID = IntegerProperty.create("plant_id", 0, 127);
|
||||||
|
|
||||||
public enum PedestalState implements StringRepresentable {
|
public enum PedestalState implements StringRepresentable {
|
||||||
PEDESTAL_TOP("pedestal_top"),
|
PEDESTAL_TOP("pedestal_top"), COLUMN_TOP("column_top"), BOTTOM("bottom"), PILLAR("pillar"), COLUMN("column"), DEFAULT("default");
|
||||||
COLUMN_TOP("column_top"),
|
|
||||||
BOTTOM("bottom"),
|
|
||||||
PILLAR("pillar"),
|
|
||||||
COLUMN("column"),
|
|
||||||
DEFAULT("default");
|
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
|
@ -41,12 +37,7 @@ public class EndBlockProperties extends BlockProperties {
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum HydraluxShape implements StringRepresentable {
|
public enum HydraluxShape implements StringRepresentable {
|
||||||
FLOWER_BIG_BOTTOM("flower_big_bottom", true),
|
FLOWER_BIG_BOTTOM("flower_big_bottom", true), FLOWER_BIG_TOP("flower_big_top", true), FLOWER_SMALL_BOTTOM("flower_small_bottom", true), FLOWER_SMALL_TOP("flower_small_top", true), VINE("vine", false), ROOTS("roots", false);
|
||||||
FLOWER_BIG_TOP("flower_big_top", true),
|
|
||||||
FLOWER_SMALL_BOTTOM("flower_small_bottom", true),
|
|
||||||
FLOWER_SMALL_TOP("flower_small_top", true),
|
|
||||||
VINE("vine", false),
|
|
||||||
ROOTS("roots", false);
|
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
private final boolean glow;
|
private final boolean glow;
|
||||||
|
@ -72,13 +63,7 @@ public class EndBlockProperties extends BlockProperties {
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum LumecornShape implements StringRepresentable {
|
public enum LumecornShape implements StringRepresentable {
|
||||||
LIGHT_TOP("light_top", 15),
|
LIGHT_TOP("light_top", 15), LIGHT_TOP_MIDDLE("light_top_middle", 15), LIGHT_MIDDLE("light_middle", 15), LIGHT_BOTTOM("light_bottom", 15), MIDDLE("middle", 0), BOTTOM_BIG("bottom_big", 0), BOTTOM_SMALL("bottom_small", 0);
|
||||||
LIGHT_TOP_MIDDLE("light_top_middle", 15),
|
|
||||||
LIGHT_MIDDLE("light_middle", 15),
|
|
||||||
LIGHT_BOTTOM("light_bottom", 15),
|
|
||||||
MIDDLE("middle", 0),
|
|
||||||
BOTTOM_BIG("bottom_big", 0),
|
|
||||||
BOTTOM_SMALL("bottom_small", 0);
|
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
private final int light;
|
private final int light;
|
||||||
|
@ -104,9 +89,7 @@ public class EndBlockProperties extends BlockProperties {
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum CactusBottom implements StringRepresentable {
|
public enum CactusBottom implements StringRepresentable {
|
||||||
EMPTY("empty"),
|
EMPTY("empty"), SAND("sand"), MOSS("moss");
|
||||||
SAND("sand"),
|
|
||||||
MOSS("moss");
|
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
|
|
|
@ -42,12 +42,7 @@ public class EndLilyBlock extends EndUnderwaterPlantBlock {
|
||||||
private static final VoxelShape SHAPE_TOP = Block.box(2, 0, 2, 14, 6, 14);
|
private static final VoxelShape SHAPE_TOP = Block.box(2, 0, 2, 14, 6, 14);
|
||||||
|
|
||||||
public EndLilyBlock() {
|
public EndLilyBlock() {
|
||||||
super(FabricBlockSettings.of(Material.WATER_PLANT)
|
super(FabricBlockSettings.of(Material.WATER_PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.WET_GRASS).lightLevel((state) -> state.getValue(SHAPE) == TripleShape.TOP ? 13 : 0).noCollission());
|
||||||
.breakByTool(FabricToolTags.SHEARS)
|
|
||||||
.breakByHand(true)
|
|
||||||
.sound(SoundType.WET_GRASS)
|
|
||||||
.lightLevel((state) -> state.getValue(SHAPE) == TripleShape.TOP ? 13 : 0)
|
|
||||||
.noCollission());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -110,8 +110,7 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock {
|
||||||
p.setX(pos.getX() + x);
|
p.setX(pos.getX() + x);
|
||||||
for (int z = -1; z < 2; z++) {
|
for (int z = -1; z < 2; z++) {
|
||||||
p.setZ(pos.getZ() + z);
|
p.setZ(pos.getZ() + z);
|
||||||
if (world.isEmptyBlock(p) && !world.getFluidState(p.below()).isEmpty())
|
if (world.isEmptyBlock(p) && !world.getFluidState(p.below()).isEmpty()) count++;
|
||||||
count++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return count == 9;
|
return count == 9;
|
||||||
|
|
|
@ -95,8 +95,7 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, I
|
||||||
BlockPos exitPos = findExitPos(currentWorld, destination, pos, entity);
|
BlockPos exitPos = findExitPos(currentWorld, destination, pos, entity);
|
||||||
if (exitPos == null) return;
|
if (exitPos == null) return;
|
||||||
if (entity instanceof ServerPlayer && ((ServerPlayer) entity).isCreative()) {
|
if (entity instanceof ServerPlayer && ((ServerPlayer) entity).isCreative()) {
|
||||||
((ServerPlayer) entity).teleportTo(destination, exitPos.getX() + 0.5, exitPos.getY(),
|
((ServerPlayer) entity).teleportTo(destination, exitPos.getX() + 0.5, exitPos.getY(), exitPos.getZ() + 0.5, entity.getYRot(), entity.getXRot());
|
||||||
exitPos.getZ() + 0.5, entity.getYRot(), entity.getXRot());
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
((TeleportingEntity) entity).be_setExitPos(exitPos);
|
((TeleportingEntity) entity).be_setExitPos(exitPos);
|
||||||
|
@ -106,8 +105,7 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, I
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean validate(Entity entity) {
|
private boolean validate(Entity entity) {
|
||||||
return !entity.isPassenger() && !entity.isVehicle() &&
|
return !entity.isPassenger() && !entity.isVehicle() && entity.canChangeDimensions() && !entity.isOnPortalCooldown();
|
||||||
entity.canChangeDimensions() && !entity.isOnPortalCooldown();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -127,8 +125,7 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, I
|
||||||
MutableBlockPos checkPos = basePos.mutable();
|
MutableBlockPos checkPos = basePos.mutable();
|
||||||
BlockState currentState = currentWorld.getBlockState(currentPos);
|
BlockState currentState = currentWorld.getBlockState(currentPos);
|
||||||
int radius = (EternalRitual.SEARCH_RADIUS >> 4) + 1;
|
int radius = (EternalRitual.SEARCH_RADIUS >> 4) + 1;
|
||||||
checkPos = EternalRitual.findBlockPos(targetWorld, checkPos, radius, this, state -> state.is(this) &&
|
checkPos = EternalRitual.findBlockPos(targetWorld, checkPos, radius, this, state -> state.is(this) && state.getValue(PORTAL).equals(currentState.getValue(PORTAL)));
|
||||||
state.getValue(PORTAL).equals(currentState.getValue(PORTAL)));
|
|
||||||
if (checkPos != null) {
|
if (checkPos != null) {
|
||||||
BlockState checkState = targetWorld.getBlockState(checkPos);
|
BlockState checkState = targetWorld.getBlockState(checkPos);
|
||||||
Axis axis = checkState.getValue(AXIS);
|
Axis axis = checkState.getValue(AXIS);
|
||||||
|
|
|
@ -49,12 +49,7 @@ public class EndStoneSmelter extends BaseBlockWithEntity {
|
||||||
public static final String ID = "end_stone_smelter";
|
public static final String ID = "end_stone_smelter";
|
||||||
|
|
||||||
public EndStoneSmelter() {
|
public EndStoneSmelter() {
|
||||||
super(FabricBlockSettings.of(Material.STONE, MaterialColor.COLOR_GRAY)
|
super(FabricBlockSettings.of(Material.STONE, MaterialColor.COLOR_GRAY).luminance(state -> state.getValue(LIT) ? 15 : 0).hardness(4F).resistance(100F).requiresCorrectToolForDrops().sound(SoundType.STONE));
|
||||||
.luminance(state -> state.getValue(LIT) ? 15 : 0)
|
|
||||||
.hardness(4F)
|
|
||||||
.resistance(100F)
|
|
||||||
.requiresCorrectToolForDrops()
|
|
||||||
.sound(SoundType.STONE));
|
|
||||||
registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH).setValue(LIT, false));
|
registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH).setValue(LIT, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,11 +14,7 @@ import ru.bclib.blocks.BaseBlock;
|
||||||
public class EnderBlock extends BaseBlock {
|
public class EnderBlock extends BaseBlock {
|
||||||
|
|
||||||
public EnderBlock() {
|
public EnderBlock() {
|
||||||
super(FabricBlockSettings.of(Material.STONE, MaterialColor.WARPED_WART_BLOCK)
|
super(FabricBlockSettings.of(Material.STONE, MaterialColor.WARPED_WART_BLOCK).hardness(5F).resistance(6F).requiresCorrectToolForDrops().sound(SoundType.STONE));
|
||||||
.hardness(5F)
|
|
||||||
.resistance(6F)
|
|
||||||
.requiresCorrectToolForDrops()
|
|
||||||
.sound(SoundType.STONE));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
|
|
|
@ -21,9 +21,7 @@ public class EndstoneDustBlock extends FallingBlock {
|
||||||
private static final int COLOR = ColorUtil.color(226, 239, 168);
|
private static final int COLOR = ColorUtil.color(226, 239, 168);
|
||||||
|
|
||||||
public EndstoneDustBlock() {
|
public EndstoneDustBlock() {
|
||||||
super(FabricBlockSettings.copyOf(Blocks.SAND)
|
super(FabricBlockSettings.copyOf(Blocks.SAND).breakByTool(FabricToolTags.SHOVELS).materialColor(Blocks.END_STONE.defaultMaterialColor()));
|
||||||
.breakByTool(FabricToolTags.SHOVELS)
|
|
||||||
.materialColor(Blocks.END_STONE.defaultMaterialColor()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -24,10 +24,7 @@ public class FlamaeaBlock extends EndPlantBlock implements ISpetialItem {
|
||||||
private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 1, 16);
|
private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 1, 16);
|
||||||
|
|
||||||
public FlamaeaBlock() {
|
public FlamaeaBlock() {
|
||||||
super(FabricBlockSettings.of(Material.PLANT)
|
super(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.WET_GRASS));
|
||||||
.breakByTool(FabricToolTags.SHEARS)
|
|
||||||
.breakByHand(true)
|
|
||||||
.sound(SoundType.WET_GRASS));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
76
src/main/java/ru/betterend/blocks/FlowerPotBlock.java
Normal file
76
src/main/java/ru/betterend/blocks/FlowerPotBlock.java
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import net.fabricmc.api.EnvType;
|
||||||
|
import net.fabricmc.api.Environment;
|
||||||
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.resources.model.BakedModel;
|
||||||
|
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||||
|
import net.minecraft.client.resources.model.UnbakedModel;
|
||||||
|
import net.minecraft.core.Registry;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.world.level.block.Block;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import net.minecraft.world.level.block.state.StateDefinition;
|
||||||
|
import net.minecraft.world.level.block.state.properties.IntegerProperty;
|
||||||
|
import ru.bclib.blocks.BaseBlockNotFull;
|
||||||
|
import ru.bclib.client.models.BlockModelProvider;
|
||||||
|
import ru.betterend.client.models.MergedModel;
|
||||||
|
import ru.betterend.interfaces.PottablePlant;
|
||||||
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class FlowerPotBlock extends BaseBlockNotFull {
|
||||||
|
private static final IntegerProperty PLANT_ID = EndBlockProperties.PLANT_ID;
|
||||||
|
private final Block[] blocks;
|
||||||
|
|
||||||
|
@Environment(EnvType.CLIENT)
|
||||||
|
private UnbakedModel source;
|
||||||
|
|
||||||
|
public FlowerPotBlock(Block source) {
|
||||||
|
super(FabricBlockSettings.copyOf(source));
|
||||||
|
List<Block> blocks = Lists.newArrayList();
|
||||||
|
EndBlocks.getModBlocks().forEach(block -> {
|
||||||
|
if (block instanceof PottablePlant) {
|
||||||
|
blocks.add(block);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.blocks = blocks.toArray(new Block[] {});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
||||||
|
super.createBlockStateDefinition(builder);
|
||||||
|
builder.add(PLANT_ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Environment(EnvType.CLIENT)
|
||||||
|
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
|
||||||
|
int id = blockState.getValue(PLANT_ID);
|
||||||
|
if (id == 0 || id > blocks.length) {
|
||||||
|
if (id == 0) {
|
||||||
|
source = super.getModelVariant(stateId, blockState, modelCache);
|
||||||
|
}
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
registerModel(stateId, blockState, modelCache);
|
||||||
|
MergedModel model = new MergedModel(blockState, source);
|
||||||
|
Block plant = blocks[id - 1];
|
||||||
|
if (plant instanceof BlockModelProvider) {
|
||||||
|
ResourceLocation location = Registry.BLOCK.getKey(plant);
|
||||||
|
//model.addModel(((BlockModelProvider) plant).getBlockModel(location, plant.defaultBlockState()));
|
||||||
|
model = new MergedModel(blockState, ((BlockModelProvider) plant).getBlockModel(location, plant.defaultBlockState()));
|
||||||
|
System.out.println("Plant " + id + " is instance!");
|
||||||
|
}
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void registerModel(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
|
||||||
|
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath());
|
||||||
|
registerBlockModel(stateId, modelId, blockState, modelCache);
|
||||||
|
}
|
||||||
|
}
|
|
@ -21,12 +21,7 @@ public class GlowingPillarLuminophorBlock extends BaseBlock {
|
||||||
public static final BooleanProperty NATURAL = EndBlockProperties.NATURAL;
|
public static final BooleanProperty NATURAL = EndBlockProperties.NATURAL;
|
||||||
|
|
||||||
public GlowingPillarLuminophorBlock() {
|
public GlowingPillarLuminophorBlock() {
|
||||||
super(FabricBlockSettings.of(Material.LEAVES)
|
super(FabricBlockSettings.of(Material.LEAVES).materialColor(MaterialColor.COLOR_ORANGE).breakByTool(FabricToolTags.SHEARS).strength(0.2F).luminance(15).sound(SoundType.GRASS));
|
||||||
.materialColor(MaterialColor.COLOR_ORANGE)
|
|
||||||
.breakByTool(FabricToolTags.SHEARS)
|
|
||||||
.strength(0.2F)
|
|
||||||
.luminance(15)
|
|
||||||
.sound(SoundType.GRASS));
|
|
||||||
this.registerDefaultState(this.stateDefinition.any().setValue(NATURAL, false));
|
this.registerDefaultState(this.stateDefinition.any().setValue(NATURAL, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,13 +23,7 @@ import java.util.Random;
|
||||||
public class GlowingPillarSeedBlock extends EndPlantWithAgeBlock {
|
public class GlowingPillarSeedBlock extends EndPlantWithAgeBlock {
|
||||||
|
|
||||||
public GlowingPillarSeedBlock() {
|
public GlowingPillarSeedBlock() {
|
||||||
super(FabricBlockSettings.of(Material.PLANT)
|
super(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.GRASS).lightLevel(state -> state.getValue(AGE) * 3 + 3).randomTicks().noCollission());
|
||||||
.breakByTool(FabricToolTags.SHEARS)
|
|
||||||
.breakByHand(true)
|
|
||||||
.sound(SoundType.GRASS)
|
|
||||||
.lightLevel(state -> state.getValue(AGE) * 3 + 3)
|
|
||||||
.randomTicks()
|
|
||||||
.noCollission());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -34,12 +34,7 @@ public class HelixTreeLeavesBlock extends BaseBlock implements IColorProvider {
|
||||||
private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0);
|
private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0);
|
||||||
|
|
||||||
public HelixTreeLeavesBlock() {
|
public HelixTreeLeavesBlock() {
|
||||||
super(FabricBlockSettings.of(Material.LEAVES)
|
super(FabricBlockSettings.of(Material.LEAVES).materialColor(MaterialColor.COLOR_ORANGE).breakByTool(FabricToolTags.SHEARS).sound(SoundType.WART_BLOCK).sound(SoundType.GRASS).strength(0.2F));
|
||||||
.materialColor(MaterialColor.COLOR_ORANGE)
|
|
||||||
.breakByTool(FabricToolTags.SHEARS)
|
|
||||||
.sound(SoundType.WART_BLOCK)
|
|
||||||
.sound(SoundType.GRASS)
|
|
||||||
.strength(0.2F));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -33,12 +33,7 @@ public class HydraluxBlock extends UnderwaterPlantBlock {
|
||||||
public static final EnumProperty<HydraluxShape> SHAPE = EndBlockProperties.HYDRALUX_SHAPE;
|
public static final EnumProperty<HydraluxShape> SHAPE = EndBlockProperties.HYDRALUX_SHAPE;
|
||||||
|
|
||||||
public HydraluxBlock() {
|
public HydraluxBlock() {
|
||||||
super(FabricBlockSettings.of(Material.WATER_PLANT)
|
super(FabricBlockSettings.of(Material.WATER_PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.WET_GRASS).lightLevel((state) -> state.getValue(SHAPE).hasGlow() ? 15 : 0).noCollission());
|
||||||
.breakByTool(FabricToolTags.SHEARS)
|
|
||||||
.breakByHand(true)
|
|
||||||
.sound(SoundType.WET_GRASS)
|
|
||||||
.lightLevel((state) -> state.getValue(SHAPE).hasGlow() ? 15 : 0)
|
|
||||||
.noCollission());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -13,13 +13,7 @@ import ru.bclib.blocks.BaseBlock;
|
||||||
|
|
||||||
public class HydraluxPetalBlock extends BaseBlock {
|
public class HydraluxPetalBlock extends BaseBlock {
|
||||||
public HydraluxPetalBlock() {
|
public HydraluxPetalBlock() {
|
||||||
this(FabricBlockSettings.of(Material.PLANT)
|
this(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.AXES).breakByHand(true).hardness(1).resistance(1).materialColor(MaterialColor.PODZOL).sound(SoundType.WART_BLOCK));
|
||||||
.breakByTool(FabricToolTags.AXES)
|
|
||||||
.breakByHand(true)
|
|
||||||
.hardness(1)
|
|
||||||
.resistance(1)
|
|
||||||
.materialColor(MaterialColor.PODZOL)
|
|
||||||
.sound(SoundType.WART_BLOCK));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public HydraluxPetalBlock(Properties settings) {
|
public HydraluxPetalBlock(Properties settings) {
|
||||||
|
|
|
@ -40,7 +40,6 @@ import ru.bclib.blocks.BlockProperties;
|
||||||
import ru.bclib.util.BlocksHelper;
|
import ru.bclib.util.BlocksHelper;
|
||||||
import ru.betterend.blocks.entities.BlockEntityHydrothermalVent;
|
import ru.betterend.blocks.entities.BlockEntityHydrothermalVent;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndParticles;
|
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
@ -51,11 +50,7 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo
|
||||||
private static final VoxelShape SHAPE = Block.box(1, 1, 1, 15, 16, 15);
|
private static final VoxelShape SHAPE = Block.box(1, 1, 1, 15, 16, 15);
|
||||||
|
|
||||||
public HydrothermalVentBlock() {
|
public HydrothermalVentBlock() {
|
||||||
super(FabricBlockSettings.of(Material.STONE)
|
super(FabricBlockSettings.of(Material.STONE).breakByTool(FabricToolTags.PICKAXES).sound(SoundType.STONE).noCollission().requiresCorrectToolForDrops());
|
||||||
.breakByTool(FabricToolTags.PICKAXES)
|
|
||||||
.sound(SoundType.STONE)
|
|
||||||
.noCollission()
|
|
||||||
.requiresCorrectToolForDrops());
|
|
||||||
this.registerDefaultState(defaultBlockState().setValue(WATERLOGGED, true).setValue(ACTIVATED, false));
|
this.registerDefaultState(defaultBlockState().setValue(WATERLOGGED, true).setValue(ACTIVATED, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@ import net.minecraft.world.phys.shapes.VoxelShape;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import ru.betterend.blocks.basis.PedestalBlock;
|
import ru.betterend.blocks.basis.PedestalBlock;
|
||||||
import ru.betterend.blocks.entities.InfusionPedestalEntity;
|
import ru.betterend.blocks.entities.InfusionPedestalEntity;
|
||||||
import ru.betterend.blocks.entities.PedestalBlockEntity;
|
|
||||||
import ru.betterend.rituals.InfusionRitual;
|
import ru.betterend.rituals.InfusionRitual;
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
|
|
|
@ -28,11 +28,7 @@ public class LargeAmaranitaBlock extends EndPlantBlock {
|
||||||
private static final VoxelShape SHAPE_TOP = Shapes.or(Block.box(1, 3, 1, 15, 16, 15), SHAPE_BOTTOM);
|
private static final VoxelShape SHAPE_TOP = Shapes.or(Block.box(1, 3, 1, 15, 16, 15), SHAPE_BOTTOM);
|
||||||
|
|
||||||
public LargeAmaranitaBlock() {
|
public LargeAmaranitaBlock() {
|
||||||
super(FabricBlockSettings.of(Material.PLANT)
|
super(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.GRASS).lightLevel((state) -> (state.getValue(SHAPE) == TripleShape.TOP) ? 15 : 0));
|
||||||
.breakByTool(FabricToolTags.SHEARS)
|
|
||||||
.breakByHand(true)
|
|
||||||
.sound(SoundType.GRASS)
|
|
||||||
.lightLevel((state) -> (state.getValue(SHAPE) == TripleShape.TOP) ? 15 : 0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -38,10 +38,7 @@ public class LumecornBlock extends BaseBlockNotFull implements IRenderTyped {
|
||||||
private static final VoxelShape SHAPE_TOP = Block.box(6, 0, 6, 10, 8, 10);
|
private static final VoxelShape SHAPE_TOP = Block.box(6, 0, 6, 10, 8, 10);
|
||||||
|
|
||||||
public LumecornBlock() {
|
public LumecornBlock() {
|
||||||
super(FabricBlockSettings.of(Material.WOOD)
|
super(FabricBlockSettings.of(Material.WOOD).breakByTool(FabricToolTags.AXES).hardness(0.5F).luminance(state -> state.getValue(SHAPE).getLight()));
|
||||||
.breakByTool(FabricToolTags.AXES)
|
|
||||||
.hardness(0.5F)
|
|
||||||
.luminance(state -> state.getValue(SHAPE).getLight()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -23,12 +23,7 @@ public class PondAnemoneBlock extends EndUnderwaterPlantBlock {
|
||||||
private static final VoxelShape SHAPE = Block.box(2, 0, 2, 14, 14, 14);
|
private static final VoxelShape SHAPE = Block.box(2, 0, 2, 14, 14, 14);
|
||||||
|
|
||||||
public PondAnemoneBlock() {
|
public PondAnemoneBlock() {
|
||||||
super(FabricBlockSettings.of(Material.WATER_PLANT)
|
super(FabricBlockSettings.of(Material.WATER_PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).luminance(13).sound(SoundType.CORAL_BLOCK).noCollission());
|
||||||
.breakByTool(FabricToolTags.SHEARS)
|
|
||||||
.breakByHand(true)
|
|
||||||
.luminance(13)
|
|
||||||
.sound(SoundType.CORAL_BLOCK)
|
|
||||||
.noCollission());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -21,11 +21,7 @@ public class RunedFlavolite extends BaseBlock {
|
||||||
public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVE;
|
public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVE;
|
||||||
|
|
||||||
public RunedFlavolite(boolean unbreakable) {
|
public RunedFlavolite(boolean unbreakable) {
|
||||||
super(FabricBlockSettings.copyOf(EndBlocks.FLAVOLITE.polished)
|
super(FabricBlockSettings.copyOf(EndBlocks.FLAVOLITE.polished).strength(unbreakable ? -1 : 1, unbreakable ? Blocks.BEDROCK.getExplosionResistance() : Blocks.OBSIDIAN.getExplosionResistance()).luminance(state -> {
|
||||||
.strength(
|
|
||||||
unbreakable ? -1 : 1,
|
|
||||||
unbreakable ? Blocks.BEDROCK.getExplosionResistance() : Blocks.OBSIDIAN.getExplosionResistance()
|
|
||||||
).luminance(state -> {
|
|
||||||
return state.getValue(ACTIVATED) ? 8 : 0;
|
return state.getValue(ACTIVATED) ? 8 : 0;
|
||||||
}));
|
}));
|
||||||
this.registerDefaultState(stateDefinition.any().setValue(ACTIVATED, false));
|
this.registerDefaultState(stateDefinition.any().setValue(ACTIVATED, false));
|
||||||
|
|
|
@ -60,10 +60,7 @@ public class SmallAmaranitaBlock extends EndPlantBlock {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkFrame(ServerLevel world, BlockPos pos) {
|
private boolean checkFrame(ServerLevel world, BlockPos pos) {
|
||||||
return world.getBlockState(pos).is(this) &&
|
return world.getBlockState(pos).is(this) && world.getBlockState(pos.south()).is(this) && world.getBlockState(pos.east()).is(this) && world.getBlockState(pos.south().east()).is(this);
|
||||||
world.getBlockState(pos.south()).is(this) &&
|
|
||||||
world.getBlockState(pos.east()).is(this) &&
|
|
||||||
world.getBlockState(pos.south().east()).is(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void replaceMushroom(ServerLevel world, BlockPos pos) {
|
private void replaceMushroom(ServerLevel world, BlockPos pos) {
|
||||||
|
|
|
@ -40,11 +40,7 @@ public class SmallJellyshroomBlock extends BaseAttachedBlock implements IRenderT
|
||||||
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
|
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
|
||||||
|
|
||||||
public SmallJellyshroomBlock() {
|
public SmallJellyshroomBlock() {
|
||||||
super(FabricBlockSettings.of(Material.PLANT)
|
super(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.NETHER_WART).noCollission());
|
||||||
.breakByTool(FabricToolTags.SHEARS)
|
|
||||||
.breakByHand(true)
|
|
||||||
.sound(SoundType.NETHER_WART)
|
|
||||||
.noCollission());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -8,12 +8,6 @@ import ru.betterend.blocks.basis.LitPillarBlock;
|
||||||
|
|
||||||
public class SmaragdantCrystalBlock extends LitPillarBlock {
|
public class SmaragdantCrystalBlock extends LitPillarBlock {
|
||||||
public SmaragdantCrystalBlock() {
|
public SmaragdantCrystalBlock() {
|
||||||
super(FabricBlockSettings.of(Material.GLASS)
|
super(FabricBlockSettings.of(Material.GLASS).breakByTool(FabricToolTags.PICKAXES).luminance(15).hardness(1F).resistance(1F).noOcclusion().sound(SoundType.AMETHYST));
|
||||||
.breakByTool(FabricToolTags.PICKAXES)
|
|
||||||
.luminance(15)
|
|
||||||
.hardness(1F)
|
|
||||||
.resistance(1F)
|
|
||||||
.noOcclusion()
|
|
||||||
.sound(SoundType.AMETHYST));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,13 +37,7 @@ public class SmaragdantCrystalShardBlock extends BaseAttachedBlock implements IR
|
||||||
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
|
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
|
||||||
|
|
||||||
public SmaragdantCrystalShardBlock() {
|
public SmaragdantCrystalShardBlock() {
|
||||||
super(FabricBlockSettings.of(Material.STONE)
|
super(FabricBlockSettings.of(Material.STONE).materialColor(MaterialColor.COLOR_GREEN).breakByTool(FabricToolTags.PICKAXES).luminance(15).sound(SoundType.AMETHYST_CLUSTER).requiresCorrectToolForDrops().noCollission());
|
||||||
.materialColor(MaterialColor.COLOR_GREEN)
|
|
||||||
.breakByTool(FabricToolTags.PICKAXES)
|
|
||||||
.luminance(15)
|
|
||||||
.sound(SoundType.AMETHYST_CLUSTER)
|
|
||||||
.requiresCorrectToolForDrops()
|
|
||||||
.noCollission());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -47,12 +47,7 @@ public class SulphurCrystalBlock extends BaseAttachedBlock implements IRenderTyp
|
||||||
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
|
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
|
||||||
|
|
||||||
public SulphurCrystalBlock() {
|
public SulphurCrystalBlock() {
|
||||||
super(FabricBlockSettings.of(Material.STONE)
|
super(FabricBlockSettings.of(Material.STONE).materialColor(MaterialColor.COLOR_YELLOW).breakByTool(FabricToolTags.PICKAXES).sound(SoundType.GLASS).requiresCorrectToolForDrops().noCollission());
|
||||||
.materialColor(MaterialColor.COLOR_YELLOW)
|
|
||||||
.breakByTool(FabricToolTags.PICKAXES)
|
|
||||||
.sound(SoundType.GLASS)
|
|
||||||
.requiresCorrectToolForDrops()
|
|
||||||
.noCollission());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -73,11 +73,6 @@ public class TenaneaFlowersBlock extends BaseVineBlock implements IColorProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
COLORS = new Vec3i[]{
|
COLORS = new Vec3i[]{new Vec3i(250, 111, 222), new Vec3i(167, 89, 255), new Vec3i(120, 207, 239), new Vec3i(255, 87, 182)};
|
||||||
new Vec3i(250, 111, 222),
|
|
||||||
new Vec3i(167, 89, 255),
|
|
||||||
new Vec3i(120, 207, 239),
|
|
||||||
new Vec3i(255, 87, 182)
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,9 +27,7 @@ public class UmbrellaTreeClusterBlock extends BaseBlock {
|
||||||
public static final BooleanProperty NATURAL = BlockProperties.NATURAL;
|
public static final BooleanProperty NATURAL = BlockProperties.NATURAL;
|
||||||
|
|
||||||
public UmbrellaTreeClusterBlock() {
|
public UmbrellaTreeClusterBlock() {
|
||||||
super(FabricBlockSettings.copyOf(Blocks.NETHER_WART_BLOCK)
|
super(FabricBlockSettings.copyOf(Blocks.NETHER_WART_BLOCK).materialColor(MaterialColor.COLOR_PURPLE).luminance(15));
|
||||||
.materialColor(MaterialColor.COLOR_PURPLE)
|
|
||||||
.luminance(15));
|
|
||||||
registerDefaultState(stateDefinition.any().setValue(NATURAL, false));
|
registerDefaultState(stateDefinition.any().setValue(NATURAL, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,9 +19,7 @@ public class UmbrellaTreeClusterEmptyBlock extends BaseBlock {
|
||||||
public static final BooleanProperty NATURAL = EndBlockProperties.NATURAL;
|
public static final BooleanProperty NATURAL = EndBlockProperties.NATURAL;
|
||||||
|
|
||||||
public UmbrellaTreeClusterEmptyBlock() {
|
public UmbrellaTreeClusterEmptyBlock() {
|
||||||
super(FabricBlockSettings.copyOf(Blocks.NETHER_WART_BLOCK)
|
super(FabricBlockSettings.copyOf(Blocks.NETHER_WART_BLOCK).materialColor(MaterialColor.COLOR_PURPLE).randomTicks());
|
||||||
.materialColor(MaterialColor.COLOR_PURPLE)
|
|
||||||
.randomTicks());
|
|
||||||
registerDefaultState(stateDefinition.any().setValue(NATURAL, false));
|
registerDefaultState(stateDefinition.any().setValue(NATURAL, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -130,8 +130,7 @@ public class EndLanternBlock extends BaseBlockNotFull implements SimpleWaterlogg
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
|
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
|
||||||
String floor = blockState.getValue(IS_FLOOR) ? "_floor" : "";
|
String floor = blockState.getValue(IS_FLOOR) ? "_floor" : "";
|
||||||
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
|
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath() + floor);
|
||||||
"block/" + stateId.getPath() + floor);
|
|
||||||
registerBlockModel(stateId, modelId, blockState, modelCache);
|
registerBlockModel(stateId, modelId, blockState, modelCache);
|
||||||
return ModelsHelper.createBlockSimple(modelId);
|
return ModelsHelper.createBlockSimple(modelId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,9 @@ package ru.betterend.blocks.basis;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import ru.bclib.api.TagAPI;
|
import ru.bclib.api.TagAPI;
|
||||||
import ru.bclib.blocks.BasePlantBlock;
|
import ru.bclib.blocks.BasePlantBlock;
|
||||||
|
import ru.betterend.interfaces.PottablePlant;
|
||||||
|
|
||||||
public class EndPlantBlock extends BasePlantBlock {
|
public class EndPlantBlock extends BasePlantBlock implements PottablePlant {
|
||||||
|
|
||||||
public EndPlantBlock() {
|
public EndPlantBlock() {
|
||||||
this(false);
|
this(false);
|
||||||
|
|
|
@ -33,22 +33,13 @@ public class FurBlock extends BaseAttachedBlock implements IRenderTyped {
|
||||||
private final int dropChance;
|
private final int dropChance;
|
||||||
|
|
||||||
public FurBlock(ItemLike drop, int light, int dropChance, boolean wet) {
|
public FurBlock(ItemLike drop, int light, int dropChance, boolean wet) {
|
||||||
super(FabricBlockSettings.of(Material.REPLACEABLE_PLANT)
|
super(FabricBlockSettings.of(Material.REPLACEABLE_PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).luminance(light).sound(wet ? SoundType.WET_GRASS : SoundType.GRASS).noCollission());
|
||||||
.breakByTool(FabricToolTags.SHEARS)
|
|
||||||
.breakByHand(true)
|
|
||||||
.luminance(light)
|
|
||||||
.sound(wet ? SoundType.WET_GRASS : SoundType.GRASS)
|
|
||||||
.noCollission());
|
|
||||||
this.drop = drop;
|
this.drop = drop;
|
||||||
this.dropChance = dropChance;
|
this.dropChance = dropChance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FurBlock(ItemLike drop, int dropChance) {
|
public FurBlock(ItemLike drop, int dropChance) {
|
||||||
super(FabricBlockSettings.of(Material.REPLACEABLE_PLANT)
|
super(FabricBlockSettings.of(Material.REPLACEABLE_PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.GRASS).noCollission());
|
||||||
.breakByTool(FabricToolTags.SHEARS)
|
|
||||||
.breakByHand(true)
|
|
||||||
.sound(SoundType.GRASS)
|
|
||||||
.noCollission());
|
|
||||||
this.drop = drop;
|
this.drop = drop;
|
||||||
this.dropChance = dropChance;
|
this.dropChance = dropChance;
|
||||||
}
|
}
|
||||||
|
|
|
@ -337,8 +337,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
||||||
public boolean isPlaceable(BlockState state) {
|
public boolean isPlaceable(BlockState state) {
|
||||||
if (!state.is(this)) return false;
|
if (!state.is(this)) return false;
|
||||||
PedestalState currentState = state.getValue(STATE);
|
PedestalState currentState = state.getValue(STATE);
|
||||||
return currentState == PedestalState.DEFAULT ||
|
return currentState == PedestalState.DEFAULT || currentState == PedestalState.PEDESTAL_TOP;
|
||||||
currentState == PedestalState.PEDESTAL_TOP;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -433,8 +432,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
|
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
|
||||||
PedestalState state = blockState.getValue(STATE);
|
PedestalState state = blockState.getValue(STATE);
|
||||||
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
|
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath() + "_" + state);
|
||||||
"block/" + stateId.getPath() + "_" + state);
|
|
||||||
registerBlockModel(stateId, modelId, blockState, modelCache);
|
registerBlockModel(stateId, modelId, blockState, modelCache);
|
||||||
return ModelsHelper.createBlockSimple(modelId);
|
return ModelsHelper.createBlockSimple(modelId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,9 +48,7 @@ public class StoneLanternBlock extends EndLanternBlock implements IColorProvider
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
|
public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
|
||||||
String blockName = resourceLocation.getPath();
|
String blockName = resourceLocation.getPath();
|
||||||
Optional<String> pattern = blockState.getValue(IS_FLOOR) ?
|
Optional<String> pattern = blockState.getValue(IS_FLOOR) ? Patterns.createJson(Patterns.BLOCK_STONE_LANTERN_FLOOR, blockName, blockName) : Patterns.createJson(Patterns.BLOCK_STONE_LANTERN_CEIL, blockName, blockName);
|
||||||
Patterns.createJson(Patterns.BLOCK_STONE_LANTERN_FLOOR, blockName, blockName) :
|
|
||||||
Patterns.createJson(Patterns.BLOCK_STONE_LANTERN_CEIL, blockName, blockName);
|
|
||||||
return ModelsHelper.fromPattern(pattern);
|
return ModelsHelper.fromPattern(pattern);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ package ru.betterend.blocks.entities;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.core.particles.ParticleTypes;
|
|
||||||
import net.minecraft.world.entity.EquipmentSlot;
|
import net.minecraft.world.entity.EquipmentSlot;
|
||||||
import net.minecraft.world.entity.LivingEntity;
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
import net.minecraft.world.item.ElytraItem;
|
import net.minecraft.world.item.ElytraItem;
|
||||||
|
|
|
@ -121,8 +121,7 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
itemStack = iterator.next();
|
itemStack = iterator.next();
|
||||||
}
|
} while (itemStack.isEmpty());
|
||||||
while (itemStack.isEmpty());
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -159,11 +158,9 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
|
||||||
|
|
||||||
protected int getSmeltTime() {
|
protected int getSmeltTime() {
|
||||||
if (level == null) return 200;
|
if (level == null) return 200;
|
||||||
int smeltTime = level.getRecipeManager().getRecipeFor(AlloyingRecipe.TYPE, this, level)
|
int smeltTime = level.getRecipeManager().getRecipeFor(AlloyingRecipe.TYPE, this, level).map(AlloyingRecipe::getSmeltTime).orElse(0);
|
||||||
.map(AlloyingRecipe::getSmeltTime).orElse(0);
|
|
||||||
if (smeltTime == 0) {
|
if (smeltTime == 0) {
|
||||||
smeltTime = level.getRecipeManager().getRecipeFor(RecipeType.BLASTING, this, level)
|
smeltTime = level.getRecipeManager().getRecipeFor(RecipeType.BLASTING, this, level).map(BlastingRecipe::getCookingTime).orElse(200);
|
||||||
.map(BlastingRecipe::getCookingTime).orElse(200);
|
|
||||||
smeltTime /= 1.5;
|
smeltTime /= 1.5;
|
||||||
}
|
}
|
||||||
return smeltTime;
|
return smeltTime;
|
||||||
|
@ -290,12 +287,10 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
|
||||||
if (recipe == null) return false;
|
if (recipe == null) return false;
|
||||||
boolean validInput;
|
boolean validInput;
|
||||||
if (recipe instanceof AlloyingRecipe) {
|
if (recipe instanceof AlloyingRecipe) {
|
||||||
validInput = !inventory.get(0).isEmpty() &&
|
validInput = !inventory.get(0).isEmpty() && !inventory.get(1).isEmpty();
|
||||||
!inventory.get(1).isEmpty();
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
validInput = !inventory.get(0).isEmpty() ||
|
validInput = !inventory.get(0).isEmpty() || !inventory.get(1).isEmpty();
|
||||||
!inventory.get(1).isEmpty();
|
|
||||||
}
|
}
|
||||||
if (validInput) {
|
if (validInput) {
|
||||||
ItemStack result = recipe.getResultItem();
|
ItemStack result = recipe.getResultItem();
|
||||||
|
|
|
@ -70,10 +70,8 @@ public class BetterEndClient implements ClientModInitializer {
|
||||||
Registry.BLOCK.forEach(block -> {
|
Registry.BLOCK.forEach(block -> {
|
||||||
if (block instanceof IRenderTyped) {
|
if (block instanceof IRenderTyped) {
|
||||||
BCLRenderLayer layer = ((IRenderTyped) block).getRenderLayer();
|
BCLRenderLayer layer = ((IRenderTyped) block).getRenderLayer();
|
||||||
if (layer == BCLRenderLayer.CUTOUT)
|
if (layer == BCLRenderLayer.CUTOUT) BlockRenderLayerMap.INSTANCE.putBlock(block, cutout);
|
||||||
BlockRenderLayerMap.INSTANCE.putBlock(block, cutout);
|
else if (layer == BCLRenderLayer.TRANSLUCENT) BlockRenderLayerMap.INSTANCE.putBlock(block, translucent);
|
||||||
else if (layer == BCLRenderLayer.TRANSLUCENT)
|
|
||||||
BlockRenderLayerMap.INSTANCE.putBlock(block, translucent);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,8 +27,7 @@ import ru.betterend.recipe.builders.AlloyingRecipe;
|
||||||
|
|
||||||
public class EndStoneSmelterScreenHandler extends RecipeBookMenu<Container> {
|
public class EndStoneSmelterScreenHandler extends RecipeBookMenu<Container> {
|
||||||
|
|
||||||
public final static MenuType<EndStoneSmelterScreenHandler> HANDLER_TYPE = ScreenHandlerRegistry.registerSimple(
|
public final static MenuType<EndStoneSmelterScreenHandler> HANDLER_TYPE = ScreenHandlerRegistry.registerSimple(BetterEnd.makeID(EndStoneSmelter.ID), EndStoneSmelterScreenHandler::new);
|
||||||
BetterEnd.makeID(EndStoneSmelter.ID), EndStoneSmelterScreenHandler::new);
|
|
||||||
|
|
||||||
private final Container inventory;
|
private final Container inventory;
|
||||||
private final ContainerData propertyDelegate;
|
private final ContainerData propertyDelegate;
|
||||||
|
|
87
src/main/java/ru/betterend/client/models/MergedModel.java
Normal file
87
src/main/java/ru/betterend/client/models/MergedModel.java
Normal file
|
@ -0,0 +1,87 @@
|
||||||
|
package ru.betterend.client.models;
|
||||||
|
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
import com.mojang.datafixers.util.Pair;
|
||||||
|
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||||
|
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||||
|
import net.minecraft.client.resources.model.BakedModel;
|
||||||
|
import net.minecraft.client.resources.model.Material;
|
||||||
|
import net.minecraft.client.resources.model.ModelBakery;
|
||||||
|
import net.minecraft.client.resources.model.ModelState;
|
||||||
|
import net.minecraft.client.resources.model.SimpleBakedModel;
|
||||||
|
import net.minecraft.client.resources.model.UnbakedModel;
|
||||||
|
import net.minecraft.core.Direction;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
import ru.bclib.util.BlocksHelper;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Random;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
public class MergedModel implements UnbakedModel {
|
||||||
|
private final List<UnbakedModel> models = Lists.newArrayList();
|
||||||
|
private final UnbakedModel source;
|
||||||
|
private final BlockState state;
|
||||||
|
|
||||||
|
public MergedModel(BlockState state, UnbakedModel source) {
|
||||||
|
this.source = source;
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addModel(UnbakedModel model) {
|
||||||
|
models.add(model);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<ResourceLocation> getDependencies() {
|
||||||
|
Set<ResourceLocation> dependencies = Sets.newHashSet();
|
||||||
|
dependencies.addAll(source.getDependencies());
|
||||||
|
models.forEach(model -> dependencies.addAll(model.getDependencies()));
|
||||||
|
return dependencies;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<Material> getMaterials(Function<ResourceLocation, UnbakedModel> function, Set<Pair<String, String>> set) {
|
||||||
|
Set<Material> material = Sets.newHashSet();
|
||||||
|
material.addAll(source.getMaterials(function, set));
|
||||||
|
models.forEach(model -> material.addAll(model.getMaterials(function, set)));
|
||||||
|
return material;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public BakedModel bake(ModelBakery modelBakery, Function<Material, TextureAtlasSprite> function, ModelState modelState, ResourceLocation resourceLocation) {
|
||||||
|
Random random = new Random(resourceLocation.toString().hashCode());
|
||||||
|
BakedModel baked = source.bake(modelBakery, function, modelState, resourceLocation);
|
||||||
|
Map<Direction, List<BakedQuad>> map = makeMap();
|
||||||
|
List<BakedQuad> quads = Lists.newArrayList();
|
||||||
|
processModel(baked, map, quads, random);
|
||||||
|
models.forEach(model -> {
|
||||||
|
BakedModel baked2 = source.bake(modelBakery, function, modelState, resourceLocation);
|
||||||
|
processModel(baked2, map, quads, random);
|
||||||
|
});
|
||||||
|
return new SimpleBakedModel(quads, map, baked.useAmbientOcclusion(), baked.usesBlockLight(), baked.isGui3d(), baked.getParticleIcon(), baked.getTransforms(), baked.getOverrides());
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<Direction, List<BakedQuad>> makeMap() {
|
||||||
|
Map<Direction, List<BakedQuad>> map = Maps.newEnumMap(Direction.class);
|
||||||
|
for (Direction dir : BlocksHelper.DIRECTIONS) {
|
||||||
|
map.put(dir, Lists.newArrayList());
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void processModel(BakedModel model, Map<Direction, List<BakedQuad>> map, List<BakedQuad> quads, Random random) {
|
||||||
|
for (Direction dir : BlocksHelper.DIRECTIONS) {
|
||||||
|
map.get(dir).addAll(model.getQuads(state, dir, random));
|
||||||
|
}
|
||||||
|
quads.addAll(model.getQuads(state, null, random));
|
||||||
|
}
|
||||||
|
}
|
|
@ -99,9 +99,7 @@ public class Patterns {
|
||||||
|
|
||||||
public static String createJson(Reader data, String parent, String block) {
|
public static String createJson(Reader data, String parent, String block) {
|
||||||
try (BufferedReader buffer = new BufferedReader(data)) {
|
try (BufferedReader buffer = new BufferedReader(data)) {
|
||||||
return buffer.lines().collect(Collectors.joining())
|
return buffer.lines().collect(Collectors.joining()).replace("%parent%", parent).replace("%block%", block);
|
||||||
.replace("%parent%", parent)
|
|
||||||
.replace("%block%", block);
|
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -127,8 +125,7 @@ public class Patterns {
|
||||||
public static Optional<String> createJson(ResourceLocation patternId, Map<String, String> textures) {
|
public static Optional<String> createJson(ResourceLocation patternId, Map<String, String> textures) {
|
||||||
ResourceManager resourceManager = Minecraft.getInstance().getResourceManager();
|
ResourceManager resourceManager = Minecraft.getInstance().getResourceManager();
|
||||||
try (InputStream input = resourceManager.getResource(patternId).getInputStream()) {
|
try (InputStream input = resourceManager.getResource(patternId).getInputStream()) {
|
||||||
String json = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8))
|
String json = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8)).lines().collect(Collectors.joining());
|
||||||
.lines().collect(Collectors.joining());
|
|
||||||
for (Entry<String, String> texture : textures.entrySet()) {
|
for (Entry<String, String> texture : textures.entrySet()) {
|
||||||
json = json.replace(texture.getKey(), texture.getValue());
|
json = json.replace(texture.getKey(), texture.getValue());
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,15 +49,9 @@ public class EndCrystalRenderer {
|
||||||
public static LayerDefinition getTexturedModelData() {
|
public static LayerDefinition getTexturedModelData() {
|
||||||
MeshDefinition modelData = new MeshDefinition();
|
MeshDefinition modelData = new MeshDefinition();
|
||||||
PartDefinition modelPartData = modelData.getRoot();
|
PartDefinition modelPartData = modelData.getRoot();
|
||||||
modelPartData.addOrReplaceChild("FRAME", CubeListBuilder.create()
|
modelPartData.addOrReplaceChild("FRAME", CubeListBuilder.create().texOffs(0, 0).addBox(-4.0f, -4.0f, -4.0f, 8.0f, 8.0f, 8.0f), PartPose.ZERO);
|
||||||
.texOffs(0, 0)
|
|
||||||
.addBox(-4.0f, -4.0f, -4.0f, 8.0f, 8.0f, 8.0f),
|
|
||||||
PartPose.ZERO);
|
|
||||||
|
|
||||||
modelPartData.addOrReplaceChild("CORE", CubeListBuilder.create()
|
modelPartData.addOrReplaceChild("CORE", CubeListBuilder.create().texOffs(32, 0).addBox(-4.0f, -4.0f, -4.0f, 8.0f, 8.0f, 8.0f), PartPose.ZERO);
|
||||||
.texOffs(32, 0)
|
|
||||||
.addBox(-4.0f, -4.0f, -4.0f, 8.0f, 8.0f, 8.0f),
|
|
||||||
PartPose.ZERO);
|
|
||||||
|
|
||||||
return LayerDefinition.create(modelData, 64, 32);
|
return LayerDefinition.create(modelData, 64, 32);
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,30 +64,15 @@ public class EternalCrystalRenderer {
|
||||||
public static LayerDefinition getTexturedModelData() {
|
public static LayerDefinition getTexturedModelData() {
|
||||||
MeshDefinition modelData = new MeshDefinition();
|
MeshDefinition modelData = new MeshDefinition();
|
||||||
PartDefinition modelPartData = modelData.getRoot();
|
PartDefinition modelPartData = modelData.getRoot();
|
||||||
modelPartData.addOrReplaceChild("SHARDS_0", CubeListBuilder.create()
|
modelPartData.addOrReplaceChild("SHARDS_0", CubeListBuilder.create().texOffs(2, 4).addBox(-5.0f, 1.0f, -3.0f, 2.0f, 8.0f, 2.0f), PartPose.ZERO);
|
||||||
.texOffs(2, 4)
|
|
||||||
.addBox(-5.0f, 1.0f, -3.0f, 2.0f, 8.0f, 2.0f),
|
|
||||||
PartPose.ZERO);
|
|
||||||
|
|
||||||
modelPartData.addOrReplaceChild("SHARDS_1", CubeListBuilder.create()
|
modelPartData.addOrReplaceChild("SHARDS_1", CubeListBuilder.create().texOffs(2, 4).addBox(3.0f, -1.0f, -1.0f, 2.0f, 8.0f, 2.0f), PartPose.ZERO);
|
||||||
.texOffs(2, 4)
|
|
||||||
.addBox(3.0f, -1.0f, -1.0f, 2.0f, 8.0f, 2.0f),
|
|
||||||
PartPose.ZERO);
|
|
||||||
|
|
||||||
modelPartData.addOrReplaceChild("SHARDS_2", CubeListBuilder.create()
|
modelPartData.addOrReplaceChild("SHARDS_2", CubeListBuilder.create().texOffs(2, 4).addBox(-1.0f, 0.0f, -5.0f, 2.0f, 4.0f, 2.0f), PartPose.ZERO);
|
||||||
.texOffs(2, 4)
|
|
||||||
.addBox(-1.0f, 0.0f, -5.0f, 2.0f, 4.0f, 2.0f),
|
|
||||||
PartPose.ZERO);
|
|
||||||
|
|
||||||
modelPartData.addOrReplaceChild("SHARDS_3", CubeListBuilder.create()
|
modelPartData.addOrReplaceChild("SHARDS_3", CubeListBuilder.create().texOffs(2, 4).addBox(0.0f, 3.0f, 4.0f, 2.0f, 6.0f, 2.0f), PartPose.ZERO);
|
||||||
.texOffs(2, 4)
|
|
||||||
.addBox(0.0f, 3.0f, 4.0f, 2.0f, 6.0f, 2.0f),
|
|
||||||
PartPose.ZERO);
|
|
||||||
|
|
||||||
modelPartData.addOrReplaceChild("CORE", CubeListBuilder.create()
|
modelPartData.addOrReplaceChild("CORE", CubeListBuilder.create().texOffs(0, 0).addBox(-2.0f, -2.0f, -2.0f, 4.0f, 12.0f, 4.0f), PartPose.ZERO);
|
||||||
.texOffs(0, 0)
|
|
||||||
.addBox(-2.0f, -2.0f, -2.0f, 4.0f, 12.0f, 4.0f),
|
|
||||||
PartPose.ZERO);
|
|
||||||
|
|
||||||
return LayerDefinition.create(modelData, 16, 16);
|
return LayerDefinition.create(modelData, 16, 16);
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,10 +100,7 @@ public class CubozoaEntity extends AbstractSchoolingFish {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AttributeSupplier.Builder createMobAttributes() {
|
public static AttributeSupplier.Builder createMobAttributes() {
|
||||||
return LivingEntity.createLivingAttributes()
|
return LivingEntity.createLivingAttributes().add(Attributes.MAX_HEALTH, 2.0).add(Attributes.FOLLOW_RANGE, 16.0).add(Attributes.MOVEMENT_SPEED, 0.5);
|
||||||
.add(Attributes.MAX_HEALTH, 2.0)
|
|
||||||
.add(Attributes.FOLLOW_RANGE, 16.0)
|
|
||||||
.add(Attributes.MOVEMENT_SPEED, 0.5);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getVariant() {
|
public int getVariant() {
|
||||||
|
|
|
@ -52,11 +52,7 @@ public class DragonflyEntity extends Animal implements FlyingAnimal {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AttributeSupplier.Builder createMobAttributes() {
|
public static AttributeSupplier.Builder createMobAttributes() {
|
||||||
return LivingEntity.createLivingAttributes()
|
return LivingEntity.createLivingAttributes().add(Attributes.MAX_HEALTH, 8.0D).add(Attributes.FOLLOW_RANGE, 16.0D).add(Attributes.FLYING_SPEED, 1.0D).add(Attributes.MOVEMENT_SPEED, 0.1D);
|
||||||
.add(Attributes.MAX_HEALTH, 8.0D)
|
|
||||||
.add(Attributes.FOLLOW_RANGE, 16.0D)
|
|
||||||
.add(Attributes.FLYING_SPEED, 1.0D)
|
|
||||||
.add(Attributes.MOVEMENT_SPEED, 0.1D);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -128,10 +128,7 @@ public class EndFishEntity extends AbstractSchoolingFish {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AttributeSupplier.Builder createMobAttributes() {
|
public static AttributeSupplier.Builder createMobAttributes() {
|
||||||
return LivingEntity.createLivingAttributes()
|
return LivingEntity.createLivingAttributes().add(Attributes.MAX_HEALTH, 2.0).add(Attributes.FOLLOW_RANGE, 16.0).add(Attributes.MOVEMENT_SPEED, 0.75);
|
||||||
.add(Attributes.MAX_HEALTH, 2.0)
|
|
||||||
.add(Attributes.FOLLOW_RANGE, 16.0)
|
|
||||||
.add(Attributes.MOVEMENT_SPEED, 0.75);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getVariant() {
|
public int getVariant() {
|
||||||
|
|
|
@ -66,11 +66,7 @@ public class EndSlimeEntity extends Slime {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AttributeSupplier.Builder createMobAttributes() {
|
public static AttributeSupplier.Builder createMobAttributes() {
|
||||||
return LivingEntity.createLivingAttributes()
|
return LivingEntity.createLivingAttributes().add(Attributes.MAX_HEALTH, 1.0D).add(Attributes.ATTACK_DAMAGE, 1.0D).add(Attributes.FOLLOW_RANGE, 16.0D).add(Attributes.MOVEMENT_SPEED, 0.15D);
|
||||||
.add(Attributes.MAX_HEALTH, 1.0D)
|
|
||||||
.add(Attributes.ATTACK_DAMAGE, 1.0D)
|
|
||||||
.add(Attributes.FOLLOW_RANGE, 16.0D)
|
|
||||||
.add(Attributes.MOVEMENT_SPEED, 0.15D);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -268,9 +264,7 @@ public class EndSlimeEntity extends Slime {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUse() {
|
public boolean canUse() {
|
||||||
return (EndSlimeEntity.this.isInWater()
|
return (EndSlimeEntity.this.isInWater() || EndSlimeEntity.this.isInLava()) && EndSlimeEntity.this.getMoveControl() instanceof EndSlimeMoveControl;
|
||||||
|| EndSlimeEntity.this.isInLava())
|
|
||||||
&& EndSlimeEntity.this.getMoveControl() instanceof EndSlimeMoveControl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void tick() {
|
public void tick() {
|
||||||
|
@ -291,12 +285,7 @@ public class EndSlimeEntity extends Slime {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUse() {
|
public boolean canUse() {
|
||||||
return EndSlimeEntity.this.getTarget() == null
|
return EndSlimeEntity.this.getTarget() == null && (EndSlimeEntity.this.onGround || EndSlimeEntity.this.isInWater() || EndSlimeEntity.this.isInLava() || EndSlimeEntity.this.hasEffect(MobEffects.LEVITATION)) && EndSlimeEntity.this.getMoveControl() instanceof EndSlimeMoveControl;
|
||||||
&& (EndSlimeEntity.this.onGround
|
|
||||||
|| EndSlimeEntity.this.isInWater()
|
|
||||||
|| EndSlimeEntity.this.isInLava()
|
|
||||||
|| EndSlimeEntity.this.hasEffect(MobEffects.LEVITATION))
|
|
||||||
&& EndSlimeEntity.this.getMoveControl() instanceof EndSlimeMoveControl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void tick() {
|
public void tick() {
|
||||||
|
|
|
@ -44,32 +44,15 @@ public class ShadowWalkerEntity extends Monster {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AttributeSupplier.Builder createMobAttributes() {
|
public static AttributeSupplier.Builder createMobAttributes() {
|
||||||
return Monster.createMonsterAttributes()
|
return Monster.createMonsterAttributes().add(Attributes.FOLLOW_RANGE, 35.0).add(Attributes.MOVEMENT_SPEED, 0.15).add(Attributes.ATTACK_DAMAGE, 4.5).add(Attributes.ARMOR, 2.0).add(Attributes.SPAWN_REINFORCEMENTS_CHANCE);
|
||||||
.add(Attributes.FOLLOW_RANGE, 35.0)
|
|
||||||
.add(Attributes.MOVEMENT_SPEED, 0.15)
|
|
||||||
.add(Attributes.ATTACK_DAMAGE, 4.5)
|
|
||||||
.add(Attributes.ARMOR, 2.0)
|
|
||||||
.add(Attributes.SPAWN_REINFORCEMENTS_CHANCE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
super.tick();
|
super.tick();
|
||||||
level.addParticle(ParticleTypes.ASH,
|
level.addParticle(ParticleTypes.ASH, getX() + random.nextGaussian() * 0.2, getY() + random.nextGaussian() * 0.5 + 1, getZ() + random.nextGaussian() * 0.2, 0, 0, 0);
|
||||||
getX() + random.nextGaussian() * 0.2,
|
level.addParticle(ParticleTypes.SMOKE, getX() + random.nextGaussian() * 0.2, getY() + random.nextGaussian() * 0.5 + 1, getZ() + random.nextGaussian() * 0.2, 0, 0, 0);
|
||||||
getY() + random.nextGaussian() * 0.5 + 1,
|
level.addParticle(ParticleTypes.ENTITY_EFFECT, getX() + random.nextGaussian() * 0.2, getY() + random.nextGaussian() * 0.5 + 1, getZ() + random.nextGaussian() * 0.2, 0, 0, 0);
|
||||||
getZ() + random.nextGaussian() * 0.2,
|
|
||||||
0, 0, 0);
|
|
||||||
level.addParticle(ParticleTypes.SMOKE,
|
|
||||||
getX() + random.nextGaussian() * 0.2,
|
|
||||||
getY() + random.nextGaussian() * 0.5 + 1,
|
|
||||||
getZ() + random.nextGaussian() * 0.2,
|
|
||||||
0, 0, 0);
|
|
||||||
level.addParticle(ParticleTypes.ENTITY_EFFECT,
|
|
||||||
getX() + random.nextGaussian() * 0.2,
|
|
||||||
getY() + random.nextGaussian() * 0.5 + 1,
|
|
||||||
getZ() + random.nextGaussian() * 0.2,
|
|
||||||
0, 0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -70,11 +70,7 @@ public class SilkMothEntity extends Animal implements FlyingAnimal {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AttributeSupplier.Builder createMobAttributes() {
|
public static AttributeSupplier.Builder createMobAttributes() {
|
||||||
return LivingEntity.createLivingAttributes()
|
return LivingEntity.createLivingAttributes().add(Attributes.MAX_HEALTH, 2.0D).add(Attributes.FOLLOW_RANGE, 16.0D).add(Attributes.FLYING_SPEED, 0.4D).add(Attributes.MOVEMENT_SPEED, 0.1D);
|
||||||
.add(Attributes.MAX_HEALTH, 2.0D)
|
|
||||||
.add(Attributes.FOLLOW_RANGE, 16.0D)
|
|
||||||
.add(Attributes.FLYING_SPEED, 0.4D)
|
|
||||||
.add(Attributes.MOVEMENT_SPEED, 0.1D);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setHive(Level world, BlockPos hive) {
|
public void setHive(Level world, BlockPos hive) {
|
||||||
|
@ -253,11 +249,7 @@ public class SilkMothEntity extends Animal implements FlyingAnimal {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canUse() {
|
public boolean canUse() {
|
||||||
return SilkMothEntity.this.hivePos != null
|
return SilkMothEntity.this.hivePos != null && SilkMothEntity.this.hiveWorld == SilkMothEntity.this.level && SilkMothEntity.this.navigation.isDone() && SilkMothEntity.this.random.nextInt(16) == 0 && SilkMothEntity.this.position().distanceToSqr(SilkMothEntity.this.hivePos.getX(), SilkMothEntity.this.hivePos.getY(), SilkMothEntity.this.hivePos.getZ()) < 64;
|
||||||
&& SilkMothEntity.this.hiveWorld == SilkMothEntity.this.level
|
|
||||||
&& SilkMothEntity.this.navigation.isDone()
|
|
||||||
&& SilkMothEntity.this.random.nextInt(16) == 0
|
|
||||||
&& SilkMothEntity.this.position().distanceToSqr(SilkMothEntity.this.hivePos.getX(), SilkMothEntity.this.hivePos.getY(), SilkMothEntity.this.hivePos.getZ()) < 64;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -26,32 +26,14 @@ public class CubozoaEntityModel extends BlockBenchModel<CubozoaEntity> {
|
||||||
MeshDefinition modelData = new MeshDefinition();
|
MeshDefinition modelData = new MeshDefinition();
|
||||||
PartDefinition modelPartData = modelData.getRoot();
|
PartDefinition modelPartData = modelData.getRoot();
|
||||||
|
|
||||||
PartDefinition bodyPart = modelPartData.addOrReplaceChild(PartNames.BODY,
|
PartDefinition bodyPart = modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create().texOffs(0, 17).addBox(-2.0F, -12.5F, -2.0F, 4.0F, 4.0F, 4.0F), PartPose.offset(0.0F, 24.0F, 0.0F));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(0, 17)
|
|
||||||
.addBox(-2.0F, -12.5F, -2.0F, 4.0F, 4.0F, 4.0F),
|
|
||||||
PartPose.offset(0.0F, 24.0F, 0.0F)
|
|
||||||
);
|
|
||||||
|
|
||||||
bodyPart.addOrReplaceChild("main_cube_r1", CubeListBuilder.create()
|
bodyPart.addOrReplaceChild("main_cube_r1", CubeListBuilder.create().texOffs(0, 0).addBox(-5.0F, -7.0F, -5.0F, 10.0F, 7.0F, 10.0F), PartPose.offsetAndRotation(0.0F, -14.0F, 0.0F, 0.0F, 0.0F, -3.1416F));
|
||||||
.texOffs(0, 0)
|
|
||||||
.addBox(-5.0F, -7.0F, -5.0F, 10.0F, 7.0F, 10.0F), PartPose.offsetAndRotation(0.0F, -14.0F, 0.0F, 0.0F, 0.0F, -3.1416F));
|
|
||||||
|
|
||||||
for (int i = 1; i <= TENTACLE_COUNT; i++) {
|
for (int i = 1; i <= TENTACLE_COUNT; i++) {
|
||||||
PartDefinition tentaclePart = bodyPart
|
PartDefinition tentaclePart = bodyPart.addOrReplaceChild("tentacle_center_" + i, CubeListBuilder.create(), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, i * 1.5708F, 0.0F));
|
||||||
.addOrReplaceChild("tentacle_center_" + i,
|
|
||||||
CubeListBuilder.create(),
|
|
||||||
PartPose.offsetAndRotation(
|
|
||||||
0.0F, 0.0F, 0.0F,
|
|
||||||
0.0F, i * 1.5708F, 0.0F
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
tentaclePart.addOrReplaceChild("tentacle_" + i, CubeListBuilder.create()
|
tentaclePart.addOrReplaceChild("tentacle_" + i, CubeListBuilder.create().texOffs(16, 17).addBox(-4.0F, 0.0F, 0.0F, 8.0F, 7.0F, 0.0F), PartPose.offset(0.0F, -7.0F, 4.5F));
|
||||||
.texOffs(16, 17)
|
|
||||||
.addBox(-4.0F, 0.0F, 0.0F, 8.0F, 7.0F, 0.0F),
|
|
||||||
PartPose.offset(0.0F, -7.0F, 4.5F));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return LayerDefinition.create(modelData, 48, 48);
|
return LayerDefinition.create(modelData, 48, 48);
|
||||||
|
|
|
@ -28,87 +28,25 @@ public class DragonflyEntityModel extends BlockBenchModel<DragonflyEntity> {
|
||||||
MeshDefinition modelData = new MeshDefinition();
|
MeshDefinition modelData = new MeshDefinition();
|
||||||
PartDefinition modelPartData = modelData.getRoot();
|
PartDefinition modelPartData = modelData.getRoot();
|
||||||
|
|
||||||
PartDefinition bodyPart = modelPartData.addOrReplaceChild(PartNames.BODY,
|
PartDefinition bodyPart = modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create().texOffs(0, 0).addBox(-4.0F, -4.0F, 0.0F, 4.0F, 4.0F, 9.0F), PartPose.offset(2.0F, 21.5F, -4.0F));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(0, 0)
|
|
||||||
.addBox(-4.0F, -4.0F, 0.0F, 4.0F, 4.0F, 9.0F),
|
|
||||||
PartPose.offset(2.0F, 21.5F, -4.0F)
|
|
||||||
);
|
|
||||||
|
|
||||||
bodyPart.addOrReplaceChild(PartNames.HEAD,
|
bodyPart.addOrReplaceChild(PartNames.HEAD, CubeListBuilder.create().texOffs(17, 0).addBox(-1.5F, -1.5F, -2.5F, 3.0F, 3.0F, 3.0F), PartPose.offsetAndRotation(-2.0F, -2.0F, 0.0F, 0.3491F, 0.0F, 0.0F));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(17, 0)
|
|
||||||
.addBox(-1.5F, -1.5F, -2.5F, 3.0F, 3.0F, 3.0F),
|
|
||||||
PartPose.offsetAndRotation(-2.0F, -2.0F, 0.0F, 0.3491F, 0.0F, 0.0F)
|
|
||||||
);
|
|
||||||
|
|
||||||
PartDefinition tailPart = bodyPart.addOrReplaceChild(PartNames.TAIL,
|
PartDefinition tailPart = bodyPart.addOrReplaceChild(PartNames.TAIL, CubeListBuilder.create().texOffs(26, 0).addBox(-1.5F, -1.5F, 0.0F, 3.0F, 3.0F, 7.0F), PartPose.offset(-2.0F, -2.0F, 9.0F));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(26, 0)
|
|
||||||
.addBox(-1.5F, -1.5F, 0.0F, 3.0F, 3.0F, 7.0F),
|
|
||||||
PartPose.offset(-2.0F, -2.0F, 9.0F)
|
|
||||||
);
|
|
||||||
|
|
||||||
tailPart.addOrReplaceChild(PartNames.TAIL_FIN,
|
tailPart.addOrReplaceChild(PartNames.TAIL_FIN, CubeListBuilder.create().texOffs(36, 0).addBox(-1.0F, -1.0F, 0.0F, 2.0F, 2.0F, 10.0F), PartPose.offset(0.0F, 0.0F, 7.0F));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(36, 0)
|
|
||||||
.addBox(-1.0F, -1.0F, 0.0F, 2.0F, 2.0F, 10.0F),
|
|
||||||
PartPose.offset(0.0F, 0.0F, 7.0F)
|
|
||||||
);
|
|
||||||
|
|
||||||
bodyPart.addOrReplaceChild(PartNames.LEFT_WING,
|
bodyPart.addOrReplaceChild(PartNames.LEFT_WING, CubeListBuilder.create().texOffs(0, 13).addBox(-15.0F, 0.0F, -3.0F, 15.0F, 0.0F, 4.0F), PartPose.offset(-2.0F, -4.0F, 4.0F));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(0, 13)
|
|
||||||
.addBox(-15.0F, 0.0F, -3.0F, 15.0F, 0.0F, 4.0F),
|
|
||||||
PartPose.offset(-2.0F, -4.0F, 4.0F)
|
|
||||||
);
|
|
||||||
|
|
||||||
bodyPart.addOrReplaceChild(PartNames.RIGHT_WING,
|
bodyPart.addOrReplaceChild(PartNames.RIGHT_WING, CubeListBuilder.create().mirror().texOffs(0, 13).addBox(0.0F, 0.0F, -3.0F, 15.0F, 0.0F, 4.0F), PartPose.offset(-2.0F, -4.0F, 4.0F));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.mirror()
|
|
||||||
.texOffs(0, 13)
|
|
||||||
.addBox(0.0F, 0.0F, -3.0F, 15.0F, 0.0F, 4.0F),
|
|
||||||
PartPose.offset(-2.0F, -4.0F, 4.0F)
|
|
||||||
);
|
|
||||||
|
|
||||||
bodyPart.addOrReplaceChild(PartNames.LEFT_WING_BASE,
|
bodyPart.addOrReplaceChild(PartNames.LEFT_WING_BASE, CubeListBuilder.create().texOffs(4, 17).addBox(-12.0F, 0.0F, -2.5F, 12.0F, 0.0F, 3.0F), PartPose.offset(-2.0F, -4.0F, 8.0F));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(4, 17)
|
|
||||||
.addBox(-12.0F, 0.0F, -2.5F, 12.0F, 0.0F, 3.0F),
|
|
||||||
PartPose.offset(-2.0F, -4.0F, 8.0F)
|
|
||||||
);
|
|
||||||
|
|
||||||
bodyPart.addOrReplaceChild(PartNames.RIGHT_WING_BASE,
|
bodyPart.addOrReplaceChild(PartNames.RIGHT_WING_BASE, CubeListBuilder.create().mirror().texOffs(4, 17).addBox(0.0F, 0.0F, -2.5F, 12.0F, 0.0F, 3.0F), PartPose.offset(-2.0F, -4.0F, 8.0F));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.mirror()
|
|
||||||
.texOffs(4, 17)
|
|
||||||
.addBox(0.0F, 0.0F, -2.5F, 12.0F, 0.0F, 3.0F),
|
|
||||||
PartPose.offset(-2.0F, -4.0F, 8.0F)
|
|
||||||
);
|
|
||||||
|
|
||||||
bodyPart.addOrReplaceChild(PartNames.LEFT_LEG,
|
bodyPart.addOrReplaceChild(PartNames.LEFT_LEG, CubeListBuilder.create().texOffs(50, 1).addBox(0.0F, 0.0F, 0.0F, 0.0F, 3.0F, 6.0F), PartPose.offsetAndRotation(-1.0F, 0.0F, 1.0F, 0.0F, 0.0F, -0.5236F));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(50, 1)
|
|
||||||
.addBox(0.0F, 0.0F, 0.0F, 0.0F, 3.0F, 6.0F),
|
|
||||||
PartPose.offsetAndRotation(-1.0F, 0.0F, 1.0F, 0.0F, 0.0F, -0.5236F)
|
|
||||||
);
|
|
||||||
|
|
||||||
bodyPart.addOrReplaceChild(PartNames.RIGHT_LEG,
|
bodyPart.addOrReplaceChild(PartNames.RIGHT_LEG, CubeListBuilder.create().texOffs(50, 1).addBox(0.0F, 0.0F, 0.0F, 0.0F, 3.0F, 6.0F), PartPose.offsetAndRotation(-3.0F, 0.0F, 1.0F, 0.0F, 0.0F, 0.5236F));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(50, 1)
|
|
||||||
.addBox(0.0F, 0.0F, 0.0F, 0.0F, 3.0F, 6.0F),
|
|
||||||
PartPose.offsetAndRotation(-3.0F, 0.0F, 1.0F, 0.0F, 0.0F, 0.5236F)
|
|
||||||
);
|
|
||||||
|
|
||||||
return LayerDefinition.create(modelData, 64, 64);
|
return LayerDefinition.create(modelData, 64, 64);
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,54 +24,17 @@ public class EndFishEntityModel extends BlockBenchModel<EndFishEntity> {
|
||||||
MeshDefinition modelData = new MeshDefinition();
|
MeshDefinition modelData = new MeshDefinition();
|
||||||
PartDefinition modelPartData = modelData.getRoot();
|
PartDefinition modelPartData = modelData.getRoot();
|
||||||
|
|
||||||
PartDefinition bodyPart = modelPartData.addOrReplaceChild(PartNames.BODY,
|
PartDefinition bodyPart = modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create().texOffs(0, 0).addBox(-1.0F, -2.0F, -4.0F, 2.0F, 4.0F, 8.0F), PartPose.offset(0.0F, 20.0F, 0.0F));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(0, 0)
|
|
||||||
.addBox(-1.0F, -2.0F, -4.0F, 2.0F, 4.0F, 8.0F),
|
|
||||||
PartPose.offset(0.0F, 20.0F, 0.0F)
|
|
||||||
);
|
|
||||||
|
|
||||||
bodyPart.addOrReplaceChild(PartNames.TOP_FIN,
|
bodyPart.addOrReplaceChild(PartNames.TOP_FIN, CubeListBuilder.create().texOffs(0, 6).addBox(0.0F, -8.0F, 0.0F, 0.0F, 8.0F, 6.0F), PartPose.offsetAndRotation(0.0F, -2.0F, -4.0F, -0.6981F, 0.0F, 0.0F));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(0, 6)
|
|
||||||
.addBox(0.0F, -8.0F, 0.0F, 0.0F, 8.0F, 6.0F),
|
|
||||||
PartPose.offsetAndRotation(0.0F, -2.0F, -4.0F, -0.6981F, 0.0F, 0.0F)
|
|
||||||
);
|
|
||||||
|
|
||||||
bodyPart.addOrReplaceChild(PartNames.BOTTOM_FIN,
|
bodyPart.addOrReplaceChild(PartNames.BOTTOM_FIN, CubeListBuilder.create().texOffs(0, 6).addBox(0.0F, 0.0F, 0.0F, 0.0F, 8.0F, 6.0F), PartPose.offsetAndRotation(0.0F, 2.0F, -4.0F, 0.6981F, 0.0F, 0.0F));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(0, 6)
|
|
||||||
.addBox(0.0F, 0.0F, 0.0F, 0.0F, 8.0F, 6.0F),
|
|
||||||
PartPose.offsetAndRotation(0.0F, 2.0F, -4.0F, 0.6981F, 0.0F, 0.0F)
|
|
||||||
);
|
|
||||||
|
|
||||||
bodyPart.addOrReplaceChild(PartNames.TAIL_FIN,
|
bodyPart.addOrReplaceChild(PartNames.TAIL_FIN, CubeListBuilder.create().texOffs(0, 15).addBox(0.0F, -5.0F, 0.0F, 0.0F, 5.0F, 5.0F), PartPose.offsetAndRotation(0.0F, 0.0F, 2.0F, -0.7854F, 0.0F, 0.0F));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(0, 15)
|
|
||||||
.addBox(0.0F, -5.0F, 0.0F, 0.0F, 5.0F, 5.0F),
|
|
||||||
PartPose.offsetAndRotation(0.0F, 0.0F, 2.0F, -0.7854F, 0.0F, 0.0F)
|
|
||||||
);
|
|
||||||
|
|
||||||
bodyPart.addOrReplaceChild(PartNames.RIGHT_FIN,
|
bodyPart.addOrReplaceChild(PartNames.RIGHT_FIN, CubeListBuilder.create().texOffs(0, 25).addBox(-3.7071F, 0.7071F, -1.5F, 3.0F, 0.0F, 3.0F), PartPose.offsetAndRotation(-1.0F, 0.0F, -1.0F, 1.5708F, 0.7854F, 0.0F));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(0, 25)
|
|
||||||
.addBox(-3.7071F, 0.7071F, -1.5F, 3.0F, 0.0F, 3.0F),
|
|
||||||
PartPose.offsetAndRotation(-1.0F, 0.0F, -1.0F, 1.5708F, 0.7854F, 0.0F)
|
|
||||||
);
|
|
||||||
|
|
||||||
bodyPart.addOrReplaceChild(PartNames.LEFT_FIN,
|
bodyPart.addOrReplaceChild(PartNames.LEFT_FIN, CubeListBuilder.create().mirror().texOffs(0, 25).addBox(0.7071F, 0.7071F, -1.5F, 3.0F, 0.0F, 3.0F), PartPose.offsetAndRotation(-1.0F, 0.0F, -1.0F, 1.5708F, -0.7854F, 0.0F));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.mirror()
|
|
||||||
.texOffs(0, 25)
|
|
||||||
.addBox(0.7071F, 0.7071F, -1.5F, 3.0F, 0.0F, 3.0F),
|
|
||||||
PartPose.offsetAndRotation(-1.0F, 0.0F, -1.0F, 1.5708F, -0.7854F, 0.0F)
|
|
||||||
);
|
|
||||||
|
|
||||||
return LayerDefinition.create(modelData, 32, 32);
|
return LayerDefinition.create(modelData, 32, 32);
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,46 +38,16 @@ public class EndSlimeEntityModel<T extends EndSlimeEntity> extends ListModel<T>
|
||||||
PartDefinition modelPartData = modelData.getRoot();
|
PartDefinition modelPartData = modelData.getRoot();
|
||||||
|
|
||||||
if (onlyShell) {
|
if (onlyShell) {
|
||||||
modelPartData.addOrReplaceChild(PartNames.BODY,
|
modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create().texOffs(0, 0).addBox(-4.0F, 16.0F, -4.0F, 8.0F, 8.0F, 8.0F), PartPose.ZERO);
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(0, 0)
|
|
||||||
.addBox(-4.0F, 16.0F, -4.0F, 8.0F, 8.0F, 8.0F),
|
|
||||||
PartPose.ZERO
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
modelPartData.addOrReplaceChild(PartNames.BODY,
|
modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create().texOffs(0, 16).addBox(-3.0F, 17.0F, -3.0F, 6.0F, 6.0F, 6.0F), PartPose.ZERO);
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(0, 16)
|
|
||||||
.addBox(-3.0F, 17.0F, -3.0F, 6.0F, 6.0F, 6.0F),
|
|
||||||
PartPose.ZERO
|
|
||||||
);
|
|
||||||
|
|
||||||
modelPartData.addOrReplaceChild(PartNames.RIGHT_EYE,
|
modelPartData.addOrReplaceChild(PartNames.RIGHT_EYE, CubeListBuilder.create().texOffs(32, 0).addBox(-3.25F, 18.0F, -3.5F, 2.0F, 2.0F, 2.0F), PartPose.ZERO);
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(32, 0)
|
|
||||||
.addBox(-3.25F, 18.0F, -3.5F, 2.0F, 2.0F, 2.0F),
|
|
||||||
PartPose.ZERO
|
|
||||||
);
|
|
||||||
|
|
||||||
modelPartData.addOrReplaceChild(PartNames.LEFT_EYE,
|
modelPartData.addOrReplaceChild(PartNames.LEFT_EYE, CubeListBuilder.create().texOffs(32, 4).addBox(1.25F, 18.0F, -3.5F, 2.0F, 2.0F, 2.0F), PartPose.ZERO);
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(32, 4)
|
|
||||||
.addBox(1.25F, 18.0F, -3.5F, 2.0F, 2.0F, 2.0F),
|
|
||||||
PartPose.ZERO
|
|
||||||
);
|
|
||||||
|
|
||||||
modelPartData.addOrReplaceChild(PartNames.MOUTH,
|
modelPartData.addOrReplaceChild(PartNames.MOUTH, CubeListBuilder.create().texOffs(32, 8).addBox(0.0F, 21.0F, -3.5F, 1.0F, 1.0F, 1.0F), PartPose.ZERO);
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(32, 8)
|
|
||||||
.addBox(0.0F, 21.0F, -3.5F, 1.0F, 1.0F, 1.0F),
|
|
||||||
PartPose.ZERO
|
|
||||||
);
|
|
||||||
|
|
||||||
PartDefinition flowerPart = modelPartData.addOrReplaceChild("flower", CubeListBuilder.create(), PartPose.ZERO);
|
PartDefinition flowerPart = modelPartData.addOrReplaceChild("flower", CubeListBuilder.create(), PartPose.ZERO);
|
||||||
PartDefinition cropPart = modelPartData.addOrReplaceChild("crop", CubeListBuilder.create(), PartPose.ZERO);
|
PartDefinition cropPart = modelPartData.addOrReplaceChild("crop", CubeListBuilder.create(), PartPose.ZERO);
|
||||||
|
@ -86,18 +56,10 @@ public class EndSlimeEntityModel<T extends EndSlimeEntity> extends ListModel<T>
|
||||||
final PartDefinition parent = i < 4 ? flowerPart : cropPart;
|
final PartDefinition parent = i < 4 ? flowerPart : cropPart;
|
||||||
final float rot = MHelper.degreesToRadians(i < 4 ? (i * 45F) : ((i - 4) * 90F + 45F));
|
final float rot = MHelper.degreesToRadians(i < 4 ? (i * 45F) : ((i - 4) * 90F + 45F));
|
||||||
|
|
||||||
PartDefinition petalRotPart = parent.addOrReplaceChild("petalRot_" + i,
|
PartDefinition petalRotPart = parent.addOrReplaceChild("petalRot_" + i, CubeListBuilder.create(), PartPose.offsetAndRotation(0, 0, 0, 0, rot, 0));
|
||||||
CubeListBuilder.create(),
|
|
||||||
PartPose.offsetAndRotation(0, 0, 0, 0, rot, 0));
|
|
||||||
|
|
||||||
|
|
||||||
petalRotPart.addOrReplaceChild("petal_" + i,
|
petalRotPart.addOrReplaceChild("petal_" + i, CubeListBuilder.create().texOffs(40, 0).addBox(0.0F, 0.0F, 0.0F, 8.0F, 8.0F, 0.0F), PartPose.offset(-4, 8, 0));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(40, 0)
|
|
||||||
.addBox(0.0F, 0.0F, 0.0F, 8.0F, 8.0F, 0.0F),
|
|
||||||
PartPose.offset(-4, 8, 0)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,124 +34,35 @@ public class SilkMothEntityModel extends BlockBenchModel<SilkMothEntity> {
|
||||||
MeshDefinition modelData = new MeshDefinition();
|
MeshDefinition modelData = new MeshDefinition();
|
||||||
PartDefinition modelPartData = modelData.getRoot();
|
PartDefinition modelPartData = modelData.getRoot();
|
||||||
|
|
||||||
PartDefinition legsL = modelPartData.addOrReplaceChild(PartNames.LEFT_LEG,
|
PartDefinition legsL = modelPartData.addOrReplaceChild(PartNames.LEFT_LEG, CubeListBuilder.create().texOffs(0, 0), PartPose.offsetAndRotation(1.5f, 19.9f, -0.45f, 0.0f, 0.0f, 0.6981f));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(0, 0),
|
|
||||||
PartPose.offsetAndRotation(1.5f, 19.9f, -0.45f, 0.0f, 0.0f, 0.6981f)
|
|
||||||
);
|
|
||||||
|
|
||||||
legsL.addOrReplaceChild("cube_r1",
|
legsL.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(0, 13).addBox(0.0216f, 0.0f, -0.5976f, 3.0f, 0.0f, 1.0f), PartPose.offsetAndRotation(0.0f, 0.0f, -1.0f, 0.0f, 0.2182f, 0.3927f));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(0, 13)
|
|
||||||
.addBox(0.0216f, 0.0f, -0.5976f, 3.0f, 0.0f, 1.0f),
|
|
||||||
PartPose.offsetAndRotation(0.0f, 0.0f, -1.0f, 0.0f, 0.2182f, 0.3927f)
|
|
||||||
);
|
|
||||||
|
|
||||||
legsL.addOrReplaceChild("cube_r2",
|
legsL.addOrReplaceChild("cube_r2", CubeListBuilder.create().texOffs(0, 15).addBox(0.0f, 0.0f, -0.6f, 3.0f, 0.0f, 1.0f), PartPose.offsetAndRotation(0.5f, 0.1f, -0.05f, 0.0f, 0.0f, 0.3927f));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(0, 15)
|
|
||||||
.addBox(0.0f, 0.0f, -0.6f, 3.0f, 0.0f, 1.0f),
|
|
||||||
PartPose.offsetAndRotation(0.5f, 0.1f, -0.05f, 0.0f, 0.0f, 0.3927f)
|
|
||||||
);
|
|
||||||
|
|
||||||
legsL.addOrReplaceChild("cube_r3",
|
legsL.addOrReplaceChild("cube_r3", CubeListBuilder.create().texOffs(0, 14).addBox(0.0f, 0.0f, -0.5f, 3.0f, 0.0f, 1.0f), PartPose.offsetAndRotation(0.0f, 0.0f, 0.9f, 0.0f, -0.2182f, 0.3927f));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(0, 14)
|
|
||||||
.addBox(0.0f, 0.0f, -0.5f, 3.0f, 0.0f, 1.0f),
|
|
||||||
PartPose.offsetAndRotation(0.0f, 0.0f, 0.9f, 0.0f, -0.2182f, 0.3927f)
|
|
||||||
);
|
|
||||||
|
|
||||||
PartDefinition legsR = modelPartData.addOrReplaceChild(PartNames.RIGHT_LEG,
|
PartDefinition legsR = modelPartData.addOrReplaceChild(PartNames.RIGHT_LEG, CubeListBuilder.create().texOffs(0, 0), PartPose.offsetAndRotation(-1.5f, 19.9f, -0.55f, 0.0f, 3.1416f, -0.6545f));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(0, 0),
|
|
||||||
PartPose.offsetAndRotation(-1.5f, 19.9f, -0.55f, 0.0f, 3.1416f, -0.6545f)
|
|
||||||
);
|
|
||||||
|
|
||||||
legsR.addOrReplaceChild("cube_r4",
|
legsR.addOrReplaceChild("cube_r4", CubeListBuilder.create().texOffs(0, 10).addBox(0.0f, 0.0f, -0.5f, 3.0f, 0.0f, 1.0f), PartPose.offsetAndRotation(0.0f, 0.0f, -1.0f, 0.0f, 0.2182f, 0.3927f));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(0, 10)
|
|
||||||
.addBox(0.0f, 0.0f, -0.5f, 3.0f, 0.0f, 1.0f),
|
|
||||||
PartPose.offsetAndRotation(0.0f, 0.0f, -1.0f, 0.0f, 0.2182f, 0.3927f)
|
|
||||||
);
|
|
||||||
|
|
||||||
legsR.addOrReplaceChild("cube_r5",
|
legsR.addOrReplaceChild("cube_r5", CubeListBuilder.create().texOffs(0, 11).addBox(0.0f, 0.0f, -0.4f, 3.0f, 0.0f, 1.0f), PartPose.offsetAndRotation(0.5f, 0.1f, -0.05f, 0.0f, 0.0f, 0.3927f));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(0, 11)
|
|
||||||
.addBox(0.0f, 0.0f, -0.4f, 3.0f, 0.0f, 1.0f),
|
|
||||||
PartPose.offsetAndRotation(0.5f, 0.1f, -0.05f, 0.0f, 0.0f, 0.3927f)
|
|
||||||
);
|
|
||||||
|
|
||||||
legsR.addOrReplaceChild("cube_r6",
|
legsR.addOrReplaceChild("cube_r6", CubeListBuilder.create().texOffs(0, 12).addBox(0.0216f, 0.0f, -0.4024f, 3.0f, 0.0f, 1.0f), PartPose.offsetAndRotation(0.0f, 0.0f, 0.9f, 0.0f, -0.2182f, 0.3927f));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(0, 12)
|
|
||||||
.addBox(0.0216f, 0.0f, -0.4024f, 3.0f, 0.0f, 1.0f),
|
|
||||||
PartPose.offsetAndRotation(0.0f, 0.0f, 0.9f, 0.0f, -0.2182f, 0.3927f)
|
|
||||||
);
|
|
||||||
|
|
||||||
PartDefinition head_pivot = modelPartData.addOrReplaceChild(PartNames.HEAD,
|
PartDefinition head_pivot = modelPartData.addOrReplaceChild(PartNames.HEAD, CubeListBuilder.create().texOffs(15, 10).addBox(-1.5f, -1.5f, -2.0f, 3.0f, 3.0f, 3.0f), PartPose.offset(0.0f, 18.0f, -3.0f));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(15, 10)
|
|
||||||
.addBox(-1.5f, -1.5f, -2.0f, 3.0f, 3.0f, 3.0f),
|
|
||||||
PartPose.offset(0.0f, 18.0f, -3.0f)
|
|
||||||
);
|
|
||||||
|
|
||||||
head_pivot.addOrReplaceChild("tendril_r_r1",
|
head_pivot.addOrReplaceChild("tendril_r_r1", CubeListBuilder.create().mirror().texOffs(23, 0).addBox(-1.5f, -5.0f, 0.0f, 3.0f, 5.0f, 0.0f), PartPose.offsetAndRotation(1.0f, -1.15f, -1.0f, 0.0f, 0.0f, 0.3927f));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.mirror()
|
|
||||||
.texOffs(23, 0)
|
|
||||||
.addBox(-1.5f, -5.0f, 0.0f, 3.0f, 5.0f, 0.0f),
|
|
||||||
PartPose.offsetAndRotation(1.0f, -1.15f, -1.0f, 0.0f, 0.0f, 0.3927f)
|
|
||||||
);
|
|
||||||
|
|
||||||
head_pivot.addOrReplaceChild("tendril_r_r2",
|
head_pivot.addOrReplaceChild("tendril_r_r2", CubeListBuilder.create().texOffs(23, 0).addBox(-1.5f, -5.0f, 0.0f, 3.0f, 5.0f, 0.0f), PartPose.offsetAndRotation(-1.0f, -1.15f, -1.0f, 0.0f, 0.0f, -0.3927f));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(23, 0)
|
|
||||||
.addBox(-1.5f, -5.0f, 0.0f, 3.0f, 5.0f, 0.0f),
|
|
||||||
PartPose.offsetAndRotation(-1.0f, -1.15f, -1.0f, 0.0f, 0.0f, -0.3927f)
|
|
||||||
);
|
|
||||||
|
|
||||||
PartDefinition bb_main = modelPartData.addOrReplaceChild(PartNames.BODY,
|
PartDefinition bb_main = modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create().texOffs(19, 19).addBox(-2.5f, -8.5f, -3.0f, 5.0f, 5.0f, 3.0f), PartPose.offset(0.0f, 24.0f, 0.0f));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(19, 19)
|
|
||||||
.addBox(-2.5f, -8.5f, -3.0f, 5.0f, 5.0f, 3.0f),
|
|
||||||
PartPose.offset(0.0f, 24.0f, 0.0f)
|
|
||||||
);
|
|
||||||
|
|
||||||
bb_main.addOrReplaceChild(PartNames.RIGHT_WING,
|
bb_main.addOrReplaceChild(PartNames.RIGHT_WING, CubeListBuilder.create().mirror().texOffs(0, 5).addBox(-7.0f, 0.0f, -3.0f, 9.0f, 0.0f, 5.0f), PartPose.offsetAndRotation(-1.5f, -6.5f, 0.5f, 0.0f, 0.0f, 0.3927f));
|
||||||
CubeListBuilder.create()
|
|
||||||
.mirror()
|
|
||||||
.texOffs(0, 5)
|
|
||||||
.addBox(-7.0f, 0.0f, -3.0f, 9.0f, 0.0f, 5.0f),
|
|
||||||
PartPose.offsetAndRotation(-1.5f, -6.5f, 0.5f, 0.0f, 0.0f, 0.3927f)
|
|
||||||
);
|
|
||||||
|
|
||||||
bb_main.addOrReplaceChild(PartNames.LEFT_WING,
|
bb_main.addOrReplaceChild(PartNames.LEFT_WING, CubeListBuilder.create().texOffs(0, 5).addBox(-2.0f, 0.0f, -3.0f, 9.0f, 0.0f, 5.0f), PartPose.offsetAndRotation(1.5f, -6.5f, 0.5f, 0.0f, 0.0f, -0.3927f));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(0, 5)
|
|
||||||
.addBox(-2.0f, 0.0f, -3.0f, 9.0f, 0.0f, 5.0f),
|
|
||||||
PartPose.offsetAndRotation(1.5f, -6.5f, 0.5f, 0.0f, 0.0f, -0.3927f)
|
|
||||||
);
|
|
||||||
|
|
||||||
bb_main.addOrReplaceChild("abdomen_r1",
|
bb_main.addOrReplaceChild("abdomen_r1", CubeListBuilder.create().texOffs(0, 10).addBox(-3.0f, -4.0f, -1.0f, 4.0f, 4.0f, 7.0f), PartPose.offsetAndRotation(1.0f, -3.9f, 0.0f, -0.3927f, 0.0f, 0.0f));
|
||||||
CubeListBuilder
|
|
||||||
.create()
|
|
||||||
.texOffs(0, 10)
|
|
||||||
.addBox(-3.0f, -4.0f, -1.0f, 4.0f, 4.0f, 7.0f),
|
|
||||||
PartPose.offsetAndRotation(1.0f, -3.9f, 0.0f, -0.3927f, 0.0f, 0.0f)
|
|
||||||
);
|
|
||||||
|
|
||||||
return LayerDefinition.create(modelData, 64, 64);
|
return LayerDefinition.create(modelData, 64, 64);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,12 +27,9 @@ public class RendererEntityEndFish extends MobRenderer<EndFishEntity, EndFishEnt
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(PoseStack matrices, MultiBufferSource vertexConsumers, int light, EndFishEntity entity,
|
public void render(PoseStack matrices, MultiBufferSource vertexConsumers, int light, EndFishEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) {
|
||||||
float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw,
|
|
||||||
float headPitch) {
|
|
||||||
VertexConsumer vertexConsumer = vertexConsumers.getBuffer(GLOW[entity.getVariant()]);
|
VertexConsumer vertexConsumer = vertexConsumers.getBuffer(GLOW[entity.getVariant()]);
|
||||||
this.getParentModel().renderToBuffer(matrices, vertexConsumer, 15728640, OverlayTexture.NO_OVERLAY,
|
this.getParentModel().renderToBuffer(matrices, vertexConsumer, 15728640, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
1.0F, 1.0F, 1.0F, 1.0F);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,12 +31,9 @@ public class RendererEntityEndSlime extends MobRenderer<EndSlimeEntity, EndSlime
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(PoseStack matrices, MultiBufferSource vertexConsumers, int light, EndSlimeEntity entity,
|
public void render(PoseStack matrices, MultiBufferSource vertexConsumers, int light, EndSlimeEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) {
|
||||||
float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw,
|
|
||||||
float headPitch) {
|
|
||||||
VertexConsumer vertexConsumer = vertexConsumers.getBuffer(GLOW[entity.getSlimeType()]);
|
VertexConsumer vertexConsumer = vertexConsumers.getBuffer(GLOW[entity.getSlimeType()]);
|
||||||
this.getParentModel().renderToBuffer(matrices, vertexConsumer, 15728640, OverlayTexture.NO_OVERLAY,
|
this.getParentModel().renderToBuffer(matrices, vertexConsumer, 15728640, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
1.0F, 1.0F, 1.0F, 1.0F);
|
|
||||||
if (entity.isLake()) {
|
if (entity.isLake()) {
|
||||||
this.getParentModel().renderFlower(matrices, vertexConsumer, 15728640, OverlayTexture.NO_OVERLAY);
|
this.getParentModel().renderFlower(matrices, vertexConsumer, 15728640, OverlayTexture.NO_OVERLAY);
|
||||||
}
|
}
|
||||||
|
@ -50,8 +47,7 @@ public class RendererEntityEndSlime extends MobRenderer<EndSlimeEntity, EndSlime
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(EndSlimeEntity slimeEntity, float f, float g, PoseStack matrixStack,
|
public void render(EndSlimeEntity slimeEntity, float f, float g, PoseStack matrixStack, MultiBufferSource vertexConsumerProvider, int i) {
|
||||||
MultiBufferSource vertexConsumerProvider, int i) {
|
|
||||||
this.shadowRadius = 0.25F * (float) slimeEntity.getSize();
|
this.shadowRadius = 0.25F * (float) slimeEntity.getSize();
|
||||||
super.render(slimeEntity, f, g, matrixStack, vertexConsumerProvider, i);
|
super.render(slimeEntity, f, g, matrixStack, vertexConsumerProvider, i);
|
||||||
}
|
}
|
||||||
|
@ -66,8 +62,7 @@ public class RendererEntityEndSlime extends MobRenderer<EndSlimeEntity, EndSlime
|
||||||
matrixStack.scale(j * h, 1.0F / j * h, j * h);
|
matrixStack.scale(j * h, 1.0F / j * h, j * h);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final class OverlayFeatureRenderer<T extends EndSlimeEntity>
|
private final class OverlayFeatureRenderer<T extends EndSlimeEntity> extends RenderLayer<T, EndSlimeEntityModel<T>> {
|
||||||
extends RenderLayer<T, EndSlimeEntityModel<T>> {
|
|
||||||
private final EndSlimeEntityModel<T> modelOrdinal;
|
private final EndSlimeEntityModel<T> modelOrdinal;
|
||||||
private final EndSlimeEntityModel<T> modelLake;
|
private final EndSlimeEntityModel<T> modelLake;
|
||||||
|
|
||||||
|
@ -77,30 +72,23 @@ public class RendererEntityEndSlime extends MobRenderer<EndSlimeEntity, EndSlime
|
||||||
modelLake = new EndSlimeEntityModel<>(ctx.getModelSet(), true);
|
modelLake = new EndSlimeEntityModel<>(ctx.getModelSet(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void render(PoseStack matrixStack, MultiBufferSource vertexConsumerProvider, int i, T livingEntity,
|
public void render(PoseStack matrixStack, MultiBufferSource vertexConsumerProvider, int i, T livingEntity, float f, float g, float h, float j, float k, float l) {
|
||||||
float f, float g, float h, float j, float k, float l) {
|
|
||||||
if (!livingEntity.isInvisible()) {
|
if (!livingEntity.isInvisible()) {
|
||||||
if (livingEntity.isLake()) {
|
if (livingEntity.isLake()) {
|
||||||
VertexConsumer vertexConsumer = vertexConsumerProvider
|
VertexConsumer vertexConsumer = vertexConsumerProvider.getBuffer(RenderType.entityCutout(this.getTextureLocation(livingEntity)));
|
||||||
.getBuffer(RenderType.entityCutout(this.getTextureLocation(livingEntity)));
|
this.getParentModel().renderFlower(matrixStack, vertexConsumer, i, LivingEntityRenderer.getOverlayCoords(livingEntity, 0.0F));
|
||||||
this.getParentModel().renderFlower(matrixStack, vertexConsumer, i,
|
|
||||||
LivingEntityRenderer.getOverlayCoords(livingEntity, 0.0F));
|
|
||||||
}
|
}
|
||||||
else if (livingEntity.isAmber() || livingEntity.isChorus()) {
|
else if (livingEntity.isAmber() || livingEntity.isChorus()) {
|
||||||
VertexConsumer vertexConsumer = vertexConsumerProvider
|
VertexConsumer vertexConsumer = vertexConsumerProvider.getBuffer(RenderType.entityCutout(this.getTextureLocation(livingEntity)));
|
||||||
.getBuffer(RenderType.entityCutout(this.getTextureLocation(livingEntity)));
|
this.getParentModel().renderCrop(matrixStack, vertexConsumer, i, LivingEntityRenderer.getOverlayCoords(livingEntity, 0.0F));
|
||||||
this.getParentModel().renderCrop(matrixStack, vertexConsumer, i,
|
|
||||||
LivingEntityRenderer.getOverlayCoords(livingEntity, 0.0F));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EndSlimeEntityModel<T> model = livingEntity.getSlimeType() == 1 ? modelLake : modelOrdinal;
|
EndSlimeEntityModel<T> model = livingEntity.getSlimeType() == 1 ? modelLake : modelOrdinal;
|
||||||
this.getParentModel().copyPropertiesTo(model);
|
this.getParentModel().copyPropertiesTo(model);
|
||||||
model.prepareMobModel(livingEntity, f, g, h);
|
model.prepareMobModel(livingEntity, f, g, h);
|
||||||
model.setupAnim(livingEntity, f, g, j, k, l);
|
model.setupAnim(livingEntity, f, g, j, k, l);
|
||||||
VertexConsumer vertexConsumer = vertexConsumerProvider
|
VertexConsumer vertexConsumer = vertexConsumerProvider.getBuffer(RenderType.entityTranslucent(this.getTextureLocation(livingEntity)));
|
||||||
.getBuffer(RenderType.entityTranslucent(this.getTextureLocation(livingEntity)));
|
model.renderToBuffer(matrixStack, vertexConsumer, i, LivingEntityRenderer.getOverlayCoords(livingEntity, 0.0F), 1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
model.renderToBuffer(matrixStack, vertexConsumer, i,
|
|
||||||
LivingEntityRenderer.getOverlayCoords(livingEntity, 0.0F), 1.0F, 1.0F, 1.0F, 1.0F);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,7 @@ import net.minecraft.resources.ResourceLocation;
|
||||||
import ru.betterend.BetterEnd;
|
import ru.betterend.BetterEnd;
|
||||||
import ru.betterend.entity.ShadowWalkerEntity;
|
import ru.betterend.entity.ShadowWalkerEntity;
|
||||||
|
|
||||||
public class RendererEntityShadowWalker
|
public class RendererEntityShadowWalker extends HumanoidMobRenderer<ShadowWalkerEntity, PlayerModel<ShadowWalkerEntity>> {
|
||||||
extends HumanoidMobRenderer<ShadowWalkerEntity, PlayerModel<ShadowWalkerEntity>> {
|
|
||||||
private static final ResourceLocation TEXTURE = BetterEnd.makeID("textures/entity/shadow_walker.png");
|
private static final ResourceLocation TEXTURE = BetterEnd.makeID("textures/entity/shadow_walker.png");
|
||||||
|
|
||||||
public RendererEntityShadowWalker(EntityRendererProvider.Context ctx) {
|
public RendererEntityShadowWalker(EntityRendererProvider.Context ctx) {
|
||||||
|
|
|
@ -32,13 +32,7 @@ public class Integrations {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
GridRecipe.make(BetterEnd.MOD_ID, "guide_book", GuideBookItem.GUIDE_BOOK)
|
GridRecipe.make(BetterEnd.MOD_ID, "guide_book", GuideBookItem.GUIDE_BOOK).checkConfig(Configs.RECIPE_CONFIG).setShape("D", "B", "C").addMaterial('D', EndItems.ENDER_DUST).addMaterial('B', Items.BOOK).addMaterial('C', EndItems.CRYSTAL_SHARDS).build();
|
||||||
.checkConfig(Configs.RECIPE_CONFIG)
|
|
||||||
.setShape("D", "B", "C")
|
|
||||||
.addMaterial('D', EndItems.ENDER_DUST)
|
|
||||||
.addMaterial('B', Items.BOOK)
|
|
||||||
.addMaterial('C', EndItems.CRYSTAL_SHARDS)
|
|
||||||
.build();
|
|
||||||
}
|
}
|
||||||
hasHydrogen = FabricLoader.getInstance().isModLoaded("hydrogen");
|
hasHydrogen = FabricLoader.getInstance().isModLoaded("hydrogen");
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,38 +18,9 @@ public class NourishIntegration extends ModIntegration {
|
||||||
Tag.Named<Item> protein = getItemTag("protein");
|
Tag.Named<Item> protein = getItemTag("protein");
|
||||||
Tag.Named<Item> sweets = getItemTag("sweets");
|
Tag.Named<Item> sweets = getItemTag("sweets");
|
||||||
|
|
||||||
TagHelper.addTag(
|
TagHelper.addTag(fats, EndItems.END_FISH_RAW, EndItems.END_FISH_COOKED);
|
||||||
fats,
|
TagHelper.addTag(fruit, EndItems.SHADOW_BERRY_RAW, EndItems.SHADOW_BERRY_COOKED, EndItems.BLOSSOM_BERRY, EndItems.SHADOW_BERRY_JELLY, EndItems.SWEET_BERRY_JELLY, EndItems.BLOSSOM_BERRY_JELLY, EndItems.AMBER_ROOT_RAW, EndItems.CHORUS_MUSHROOM_RAW, EndItems.CHORUS_MUSHROOM_COOKED, EndItems.BOLUX_MUSHROOM_COOKED);
|
||||||
EndItems.END_FISH_RAW,
|
TagHelper.addTag(protein, EndItems.END_FISH_RAW, EndItems.END_FISH_COOKED, EndItems.CHORUS_MUSHROOM_COOKED, EndItems.BOLUX_MUSHROOM_COOKED, EndItems.CAVE_PUMPKIN_PIE);
|
||||||
EndItems.END_FISH_COOKED
|
TagHelper.addTag(sweets, EndItems.SHADOW_BERRY_JELLY, EndItems.SWEET_BERRY_JELLY, EndItems.BLOSSOM_BERRY_JELLY, EndItems.CAVE_PUMPKIN_PIE);
|
||||||
);
|
|
||||||
TagHelper.addTag(
|
|
||||||
fruit,
|
|
||||||
EndItems.SHADOW_BERRY_RAW,
|
|
||||||
EndItems.SHADOW_BERRY_COOKED,
|
|
||||||
EndItems.BLOSSOM_BERRY,
|
|
||||||
EndItems.SHADOW_BERRY_JELLY,
|
|
||||||
EndItems.SWEET_BERRY_JELLY,
|
|
||||||
EndItems.BLOSSOM_BERRY_JELLY,
|
|
||||||
EndItems.AMBER_ROOT_RAW,
|
|
||||||
EndItems.CHORUS_MUSHROOM_RAW,
|
|
||||||
EndItems.CHORUS_MUSHROOM_COOKED,
|
|
||||||
EndItems.BOLUX_MUSHROOM_COOKED
|
|
||||||
);
|
|
||||||
TagHelper.addTag(
|
|
||||||
protein,
|
|
||||||
EndItems.END_FISH_RAW,
|
|
||||||
EndItems.END_FISH_COOKED,
|
|
||||||
EndItems.CHORUS_MUSHROOM_COOKED,
|
|
||||||
EndItems.BOLUX_MUSHROOM_COOKED,
|
|
||||||
EndItems.CAVE_PUMPKIN_PIE
|
|
||||||
);
|
|
||||||
TagHelper.addTag(
|
|
||||||
sweets,
|
|
||||||
EndItems.SHADOW_BERRY_JELLY,
|
|
||||||
EndItems.SWEET_BERRY_JELLY,
|
|
||||||
EndItems.BLOSSOM_BERRY_JELLY,
|
|
||||||
EndItems.CAVE_PUMPKIN_PIE
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,19 +26,7 @@ public class NightshadeRedwoods extends EndBiome {
|
||||||
Biome biome = Integrations.BYG.getBiome("nightshade_forest");
|
Biome biome = Integrations.BYG.getBiome("nightshade_forest");
|
||||||
BiomeSpecialEffects effects = biome.getSpecialEffects();
|
BiomeSpecialEffects effects = biome.getSpecialEffects();
|
||||||
|
|
||||||
BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("nightshade_redwoods"))
|
BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("nightshade_redwoods")).setFogColor(140, 108, 47).setFogDensity(1.5F).setWaterAndFogColor(55, 70, 186).setFoliageColor(122, 17, 155).setParticles(ParticleTypes.REVERSE_PORTAL, 0.002F).setSurface(biome.getGenerationSettings().getSurfaceBuilder().get()).setGrassColor(48, 13, 89).setPlantsColor(200, 125, 9).addFeature(EndFeatures.END_LAKE_RARE).addFeature(BYGFeatures.NIGHTSHADE_REDWOOD_TREE).addFeature(BYGFeatures.NIGHTSHADE_MOSS_WOOD).addFeature(BYGFeatures.NIGHTSHADE_MOSS);
|
||||||
.setFogColor(140, 108, 47)
|
|
||||||
.setFogDensity(1.5F)
|
|
||||||
.setWaterAndFogColor(55, 70, 186)
|
|
||||||
.setFoliageColor(122, 17, 155)
|
|
||||||
.setParticles(ParticleTypes.REVERSE_PORTAL, 0.002F)
|
|
||||||
.setSurface(biome.getGenerationSettings().getSurfaceBuilder().get())
|
|
||||||
.setGrassColor(48, 13, 89)
|
|
||||||
.setPlantsColor(200, 125, 9)
|
|
||||||
.addFeature(EndFeatures.END_LAKE_RARE)
|
|
||||||
.addFeature(BYGFeatures.NIGHTSHADE_REDWOOD_TREE)
|
|
||||||
.addFeature(BYGFeatures.NIGHTSHADE_MOSS_WOOD)
|
|
||||||
.addFeature(BYGFeatures.NIGHTSHADE_MOSS);
|
|
||||||
|
|
||||||
if (BCLib.isClient()) {
|
if (BCLib.isClient()) {
|
||||||
SoundEvent loop = effects.getAmbientLoopSoundEvent().get();
|
SoundEvent loop = effects.getAmbientLoopSoundEvent().get();
|
||||||
|
|
|
@ -44,15 +44,7 @@ public class OldBulbisGardens extends EndBiome {
|
||||||
|
|
||||||
Block ivis = Integrations.BYG.getBlock("ivis_phylium");
|
Block ivis = Integrations.BYG.getBlock("ivis_phylium");
|
||||||
Block origin = biome.getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial().getBlock();
|
Block origin = biome.getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial().getBlock();
|
||||||
BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("old_bulbis_gardens"))
|
BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("old_bulbis_gardens")).setFogColor(215, 132, 207).setFogDensity(1.8F).setWaterAndFogColor(40, 0, 56).setFoliageColor(122, 17, 155).setParticles(ParticleTypes.REVERSE_PORTAL, 0.002F).setSurface(ivis, origin).addFeature(EndFeatures.END_LAKE_RARE).addFeature(BYGFeatures.OLD_BULBIS_TREE);
|
||||||
.setFogColor(215, 132, 207)
|
|
||||||
.setFogDensity(1.8F)
|
|
||||||
.setWaterAndFogColor(40, 0, 56)
|
|
||||||
.setFoliageColor(122, 17, 155)
|
|
||||||
.setParticles(ParticleTypes.REVERSE_PORTAL, 0.002F)
|
|
||||||
.setSurface(ivis, origin)
|
|
||||||
.addFeature(EndFeatures.END_LAKE_RARE)
|
|
||||||
.addFeature(BYGFeatures.OLD_BULBIS_TREE);
|
|
||||||
|
|
||||||
if (BCLib.isClient()) {
|
if (BCLib.isClient()) {
|
||||||
SoundEvent loop = effects.getAmbientLoopSoundEvent().get();
|
SoundEvent loop = effects.getAmbientLoopSoundEvent().get();
|
||||||
|
@ -90,11 +82,7 @@ public class OldBulbisGardens extends EndBiome {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def.addFeature(EndFeatures.PURPLE_POLYPORE)
|
def.addFeature(EndFeatures.PURPLE_POLYPORE).addFeature(BYGFeatures.IVIS_MOSS_WOOD).addFeature(BYGFeatures.IVIS_MOSS).addFeature(BYGFeatures.IVIS_VINE).addFeature(BYGFeatures.IVIS_SPROUT);
|
||||||
.addFeature(BYGFeatures.IVIS_MOSS_WOOD)
|
|
||||||
.addFeature(BYGFeatures.IVIS_MOSS)
|
|
||||||
.addFeature(BYGFeatures.IVIS_VINE)
|
|
||||||
.addFeature(BYGFeatures.IVIS_SPROUT);
|
|
||||||
|
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,8 +24,7 @@ public class BigEtherTreeFeature extends DefaultFeature {
|
||||||
final Random random = featureConfig.random();
|
final Random random = featureConfig.random();
|
||||||
final BlockPos pos = featureConfig.origin();
|
final BlockPos pos = featureConfig.origin();
|
||||||
final WorldGenLevel world = featureConfig.level();
|
final WorldGenLevel world = featureConfig.level();
|
||||||
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND))
|
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false;
|
||||||
return false;
|
|
||||||
|
|
||||||
BlockState log = Integrations.BYG.getDefaultState("ether_log");
|
BlockState log = Integrations.BYG.getDefaultState("ether_log");
|
||||||
BlockState wood = Integrations.BYG.getDefaultState("ether_wood");
|
BlockState wood = Integrations.BYG.getDefaultState("ether_wood");
|
||||||
|
@ -33,8 +32,7 @@ public class BigEtherTreeFeature extends DefaultFeature {
|
||||||
return log;
|
return log;
|
||||||
};
|
};
|
||||||
Function<BlockState, Boolean> replace = (state) -> {
|
Function<BlockState, Boolean> replace = (state) -> {
|
||||||
return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT)
|
return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getMaterial().isReplaceable();
|
||||||
|| state.getMaterial().isReplaceable();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
int height = MHelper.randRange(40, 60, random);
|
int height = MHelper.randRange(40, 60, random);
|
||||||
|
@ -64,8 +62,7 @@ public class BigEtherTreeFeature extends DefaultFeature {
|
||||||
}
|
}
|
||||||
|
|
||||||
sdf.setReplaceFunction((state) -> {
|
sdf.setReplaceFunction((state) -> {
|
||||||
return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT)
|
return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getMaterial().isReplaceable();
|
||||||
|| state.getMaterial().isReplaceable();
|
|
||||||
}).addPostProcess((info) -> {
|
}).addPostProcess((info) -> {
|
||||||
if (info.getState().equals(log) && (!info.getStateUp().equals(log) || !info.getStateDown().equals(log))) {
|
if (info.getState().equals(log) && (!info.getStateUp().equals(log) || !info.getStateDown().equals(log))) {
|
||||||
return wood;
|
return wood;
|
||||||
|
|
|
@ -38,8 +38,7 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature {
|
||||||
final Random random = featureConfig.random();
|
final Random random = featureConfig.random();
|
||||||
final BlockPos pos = featureConfig.origin();
|
final BlockPos pos = featureConfig.origin();
|
||||||
final WorldGenLevel world = featureConfig.level();
|
final WorldGenLevel world = featureConfig.level();
|
||||||
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND))
|
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false;
|
||||||
return false;
|
|
||||||
|
|
||||||
BlockState log = Integrations.BYG.getDefaultState("nightshade_log");
|
BlockState log = Integrations.BYG.getDefaultState("nightshade_log");
|
||||||
BlockState wood = Integrations.BYG.getDefaultState("nightshade_wood");
|
BlockState wood = Integrations.BYG.getDefaultState("nightshade_wood");
|
||||||
|
@ -50,8 +49,7 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature {
|
||||||
return log;
|
return log;
|
||||||
};
|
};
|
||||||
Function<BlockState, Boolean> replace = (state) -> {
|
Function<BlockState, Boolean> replace = (state) -> {
|
||||||
return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT)
|
return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getMaterial().isReplaceable();
|
||||||
|| state.getMaterial().isReplaceable();
|
|
||||||
};
|
};
|
||||||
Function<PosInfo, BlockState> post = (info) -> {
|
Function<PosInfo, BlockState> post = (info) -> {
|
||||||
if (info.getState().equals(log) && (!info.getStateUp().equals(log) || !info.getStateDown().equals(log))) {
|
if (info.getState().equals(log) && (!info.getStateUp().equals(log) || !info.getStateDown().equals(log))) {
|
||||||
|
@ -92,8 +90,7 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature {
|
||||||
|
|
||||||
SDF sdf = SplineHelper.buildSDF(trunk, 2.3F, 0.8F, splinePlacer);
|
SDF sdf = SplineHelper.buildSDF(trunk, 2.3F, 0.8F, splinePlacer);
|
||||||
SDF roots = new SDFSphere().setRadius(2F).setBlock(log);
|
SDF roots = new SDFSphere().setRadius(2F).setBlock(log);
|
||||||
roots = new SDFFlatWave().setIntensity(2F).setRaysCount(MHelper.randRange(5, 7, random))
|
roots = new SDFFlatWave().setIntensity(2F).setRaysCount(MHelper.randRange(5, 7, random)).setAngle(random.nextFloat() * MHelper.PI2).setSource(roots);
|
||||||
.setAngle(random.nextFloat() * MHelper.PI2).setSource(roots);
|
|
||||||
sdf = new SDFSmoothUnion().setRadius(2F).setSourceA(sdf).setSourceB(roots);
|
sdf = new SDFSmoothUnion().setRadius(2F).setSourceA(sdf).setSourceB(roots);
|
||||||
sdf.setReplaceFunction(replace).addPostProcess(post).fillRecursive(world, pos);
|
sdf.setReplaceFunction(replace).addPostProcess(post).fillRecursive(world, pos);
|
||||||
Vector3f last = SplineHelper.getPos(trunk, trunk.size() - 1.35F);
|
Vector3f last = SplineHelper.getPos(trunk, trunk.size() - 1.35F);
|
||||||
|
@ -178,14 +175,12 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature {
|
||||||
canopy = new SDFDisplacement().setFunction((vec) -> {
|
canopy = new SDFDisplacement().setFunction((vec) -> {
|
||||||
return MHelper.randRange(-3F, 3F, random);
|
return MHelper.randRange(-3F, 3F, random);
|
||||||
}).setSource(canopy);
|
}).setSource(canopy);
|
||||||
canopy.addPostProcess(leavesPost1).addPostProcess(leavesPost2).fillRecursiveIgnore(world,
|
canopy.addPostProcess(leavesPost1).addPostProcess(leavesPost2).fillRecursiveIgnore(world, pos.offset(0, height * 0.75, 0), ignore);
|
||||||
pos.offset(0, height * 0.75, 0), ignore);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
BRANCH = Lists.newArrayList(new Vector3f(0, 0, 0), new Vector3f(0.25F, 0.1F, 0), new Vector3f(0.40F, 0.2F, 0),
|
BRANCH = Lists.newArrayList(new Vector3f(0, 0, 0), new Vector3f(0.25F, 0.1F, 0), new Vector3f(0.40F, 0.2F, 0), new Vector3f(0.50F, 0.4F, 0), new Vector3f(0.55F, 0.6F, 0));
|
||||||
new Vector3f(0.50F, 0.4F, 0), new Vector3f(0.55F, 0.6F, 0));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,20 +39,16 @@ public class OldBulbisTreeFeature extends DefaultFeature {
|
||||||
final Random random = featureConfig.random();
|
final Random random = featureConfig.random();
|
||||||
final BlockPos pos = featureConfig.origin();
|
final BlockPos pos = featureConfig.origin();
|
||||||
final WorldGenLevel world = featureConfig.level();
|
final WorldGenLevel world = featureConfig.level();
|
||||||
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND))
|
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false;
|
||||||
return false;
|
if (!world.getBlockState(pos.below(4)).is(TagAPI.GEN_TERRAIN)) return false;
|
||||||
if (!world.getBlockState(pos.below(4)).is(TagAPI.GEN_TERRAIN))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
BlockState stem = Integrations.BYG.getDefaultState("bulbis_stem");
|
BlockState stem = Integrations.BYG.getDefaultState("bulbis_stem");
|
||||||
BlockState wood = Integrations.BYG.getDefaultState("bulbis_wood");
|
BlockState wood = Integrations.BYG.getDefaultState("bulbis_wood");
|
||||||
BlockState cap = Integrations.BYG
|
BlockState cap = Integrations.BYG.getDefaultState(random.nextBoolean() ? "bulbis_shell" : "purple_bulbis_shell");
|
||||||
.getDefaultState(random.nextBoolean() ? "bulbis_shell" : "purple_bulbis_shell");
|
|
||||||
BlockState glow = Integrations.BYG.getDefaultState("purple_shroomlight");
|
BlockState glow = Integrations.BYG.getDefaultState("purple_shroomlight");
|
||||||
|
|
||||||
Function<BlockState, Boolean> replacement = (state) -> {
|
Function<BlockState, Boolean> replacement = (state) -> {
|
||||||
if (state.equals(stem) || state.equals(wood) || state.is(TagAPI.END_GROUND)
|
if (state.equals(stem) || state.equals(wood) || state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT)) {
|
||||||
|| state.getMaterial().equals(Material.PLANT)) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return state.getMaterial().isReplaceable();
|
return state.getMaterial().isReplaceable();
|
||||||
|
@ -91,8 +87,7 @@ public class OldBulbisTreeFeature extends DefaultFeature {
|
||||||
}
|
}
|
||||||
|
|
||||||
sdf.setReplaceFunction(replacement).addPostProcess((info) -> {
|
sdf.setReplaceFunction(replacement).addPostProcess((info) -> {
|
||||||
if (info.getState().equals(stem)
|
if (info.getState().equals(stem) && (!info.getStateUp().equals(stem) || !info.getStateDown().equals(stem))) {
|
||||||
&& (!info.getStateUp().equals(stem) || !info.getStateDown().equals(stem))) {
|
|
||||||
return wood;
|
return wood;
|
||||||
}
|
}
|
||||||
return info.getState();
|
return info.getState();
|
||||||
|
@ -101,8 +96,7 @@ public class OldBulbisTreeFeature extends DefaultFeature {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bigSphere(WorldGenLevel world, BlockPos pos, float radius, BlockState cap, BlockState glow,
|
private void bigSphere(WorldGenLevel world, BlockPos pos, float radius, BlockState cap, BlockState glow, BlockState wood, Function<BlockState, Boolean> replacement, Random random) {
|
||||||
BlockState wood, Function<BlockState, Boolean> replacement, Random random) {
|
|
||||||
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong());
|
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong());
|
||||||
SDF sphere = new SDFSphere().setRadius(radius).setBlock(cap);
|
SDF sphere = new SDFSphere().setRadius(radius).setBlock(cap);
|
||||||
|
|
||||||
|
@ -149,8 +143,7 @@ public class OldBulbisTreeFeature extends DefaultFeature {
|
||||||
sphere.fillArea(world, pos, new AABB(pos.above((int) offsetY)).inflate(radius * 1.3F));
|
sphere.fillArea(world, pos, new AABB(pos.above((int) offsetY)).inflate(radius * 1.3F));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void makeRoots(WorldGenLevel world, BlockPos pos, float radius, Random random, BlockState wood,
|
private void makeRoots(WorldGenLevel world, BlockPos pos, float radius, Random random, BlockState wood, Function<BlockState, Boolean> replacement) {
|
||||||
Function<BlockState, Boolean> replacement) {
|
|
||||||
int count = (int) (radius * 1.5F);
|
int count = (int) (radius * 1.5F);
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
float angle = (float) i / (float) count * MHelper.PI2;
|
float angle = (float) i / (float) count * MHelper.PI2;
|
||||||
|
@ -167,18 +160,13 @@ public class OldBulbisTreeFeature extends DefaultFeature {
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
SPLINE = Lists.newArrayList(new Vector3f(0.00F, 0.00F, 0.00F), new Vector3f(0.10F, 0.35F, 0.00F),
|
SPLINE = Lists.newArrayList(new Vector3f(0.00F, 0.00F, 0.00F), new Vector3f(0.10F, 0.35F, 0.00F), new Vector3f(0.20F, 0.50F, 0.00F), new Vector3f(0.30F, 0.55F, 0.00F), new Vector3f(0.42F, 0.70F, 0.00F), new Vector3f(0.50F, 1.00F, 0.00F));
|
||||||
new Vector3f(0.20F, 0.50F, 0.00F), new Vector3f(0.30F, 0.55F, 0.00F), new Vector3f(0.42F, 0.70F, 0.00F),
|
|
||||||
new Vector3f(0.50F, 1.00F, 0.00F));
|
|
||||||
|
|
||||||
ROOT = Lists.newArrayList(new Vector3f(0F, 1F, 0), new Vector3f(0.1F, 0.70F, 0), new Vector3f(0.3F, 0.30F, 0),
|
ROOT = Lists.newArrayList(new Vector3f(0F, 1F, 0), new Vector3f(0.1F, 0.70F, 0), new Vector3f(0.3F, 0.30F, 0), new Vector3f(0.7F, 0.05F, 0), new Vector3f(0.8F, -0.20F, 0));
|
||||||
new Vector3f(0.7F, 0.05F, 0), new Vector3f(0.8F, -0.20F, 0));
|
|
||||||
SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0));
|
SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0));
|
||||||
|
|
||||||
LEAF = Lists.newArrayList(new Vector3f(0.00F, 0.0F, 0), new Vector3f(0.10F, 0.4F, 0),
|
LEAF = Lists.newArrayList(new Vector3f(0.00F, 0.0F, 0), new Vector3f(0.10F, 0.4F, 0), new Vector3f(0.40F, 0.8F, 0), new Vector3f(0.75F, 0.9F, 0), new Vector3f(1.00F, 0.8F, 0));
|
||||||
new Vector3f(0.40F, 0.8F, 0), new Vector3f(0.75F, 0.9F, 0), new Vector3f(1.00F, 0.8F, 0));
|
|
||||||
|
|
||||||
SIDE = Lists.newArrayList(new Vector3f(0, -0.3F, -0.5F), new Vector3f(0, -0.1F, -0.3F),
|
SIDE = Lists.newArrayList(new Vector3f(0, -0.3F, -0.5F), new Vector3f(0, -0.1F, -0.3F), new Vector3f(0, 0.0F, 0.0F), new Vector3f(0, -0.1F, 0.3F), new Vector3f(0, -0.3F, 0.5F));
|
||||||
new Vector3f(0, 0.0F, 0.0F), new Vector3f(0, -0.1F, 0.3F), new Vector3f(0, -0.3F, 0.5F));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,8 +51,7 @@ public class REIAlloyingCategory implements TransferDisplayCategory<REIAlloyingD
|
||||||
widgets.add(Widgets.createRecipeBase(bounds));
|
widgets.add(Widgets.createRecipeBase(bounds));
|
||||||
widgets.add(Widgets.createResultSlotBackground(new Point(startPoint.x + 61, startPoint.y + 9)));
|
widgets.add(Widgets.createResultSlotBackground(new Point(startPoint.x + 61, startPoint.y + 9)));
|
||||||
widgets.add(Widgets.createBurningFire(new Point(startPoint.x - 9, startPoint.y + 20)).animationDurationMS(10000));
|
widgets.add(Widgets.createBurningFire(new Point(startPoint.x - 9, startPoint.y + 20)).animationDurationMS(10000));
|
||||||
widgets.add(Widgets.createLabel(new Point(bounds.x + bounds.width - 5, bounds.y + 5),
|
widgets.add(Widgets.createLabel(new Point(bounds.x + bounds.width - 5, bounds.y + 5), new TranslatableComponent("category.rei.cooking.time&xp", df.format(display.getXp()), df.format(smeltTime / 20D))).noShadow().rightAligned().color(0xFF404040, 0xFFBBBBBB));
|
||||||
new TranslatableComponent("category.rei.cooking.time&xp", df.format(display.getXp()), df.format(smeltTime / 20D))).noShadow().rightAligned().color(0xFF404040, 0xFFBBBBBB));
|
|
||||||
widgets.add(Widgets.createArrow(new Point(startPoint.x + 24, startPoint.y + 8)).animationDurationTicks(smeltTime));
|
widgets.add(Widgets.createArrow(new Point(startPoint.x + 24, startPoint.y + 8)).animationDurationTicks(smeltTime));
|
||||||
List<EntryIngredient> inputEntries = display.getInputEntries();
|
List<EntryIngredient> inputEntries = display.getInputEntries();
|
||||||
widgets.add(Widgets.createSlot(new Point(startPoint.x - 20, startPoint.y + 1)).entries(inputEntries.get(0)).markInput());
|
widgets.add(Widgets.createSlot(new Point(startPoint.x - 20, startPoint.y + 1)).entries(inputEntries.get(0)).markInput());
|
||||||
|
@ -67,8 +66,7 @@ public class REIAlloyingCategory implements TransferDisplayCategory<REIAlloyingD
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderRedSlots(PoseStack matrices, List<Widget> widgets, Rectangle bounds, REIAlloyingDisplay display,
|
public void renderRedSlots(PoseStack matrices, List<Widget> widgets, Rectangle bounds, REIAlloyingDisplay display, IntList redSlots) {
|
||||||
IntList redSlots) {
|
|
||||||
Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
|
Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
|
||||||
matrices.pushPose();
|
matrices.pushPose();
|
||||||
matrices.translate(0, 0, 400);
|
matrices.translate(0, 0, 400);
|
||||||
|
|
|
@ -34,10 +34,7 @@ public class REIAlloyingDisplay extends BasicDisplay implements SimpleGridMenuDi
|
||||||
}
|
}
|
||||||
|
|
||||||
protected REIAlloyingDisplay(Recipe<?> recipe, float xp, double smeltTime) {
|
protected REIAlloyingDisplay(Recipe<?> recipe, float xp, double smeltTime) {
|
||||||
super(
|
super(EntryIngredients.ofIngredients(recipe.getIngredients()), Collections.singletonList(EntryIngredients.of(recipe.getResultItem())));
|
||||||
EntryIngredients.ofIngredients(recipe.getIngredients()),
|
|
||||||
Collections.singletonList(EntryIngredients.of(recipe.getResultItem()))
|
|
||||||
);
|
|
||||||
this.recipe = recipe;
|
this.recipe = recipe;
|
||||||
this.xp = xp;
|
this.xp = xp;
|
||||||
this.smeltTime = smeltTime;
|
this.smeltTime = smeltTime;
|
||||||
|
@ -91,9 +88,6 @@ public class REIAlloyingDisplay extends BasicDisplay implements SimpleGridMenuDi
|
||||||
// }
|
// }
|
||||||
|
|
||||||
static {
|
static {
|
||||||
fuel = EndStoneSmelterBlockEntity.availableFuels().keySet().stream()
|
fuel = EndStoneSmelterBlockEntity.availableFuels().keySet().stream().map(Item::getDefaultInstance).map(EntryStacks::of).map(e -> e.setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(new TranslatableComponent("category.rei.smelting.fuel").withStyle(ChatFormatting.YELLOW)))).collect(Collectors.toList());
|
||||||
.map(Item::getDefaultInstance).map(EntryStacks::of)
|
|
||||||
.map(e -> e.setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(new TranslatableComponent("category.rei.smelting.fuel")
|
|
||||||
.withStyle(ChatFormatting.YELLOW)))).collect(Collectors.toList());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,8 +52,7 @@ public class REIAlloyingFuelCategory implements DisplayCategory<REIAlloyingFuelD
|
||||||
String burnTime = DECIMAL_FORMAT.format(recipeDisplay.getFuelTime());
|
String burnTime = DECIMAL_FORMAT.format(recipeDisplay.getFuelTime());
|
||||||
List<Widget> widgets = Lists.newArrayList();
|
List<Widget> widgets = Lists.newArrayList();
|
||||||
widgets.add(Widgets.createRecipeBase(bounds));
|
widgets.add(Widgets.createRecipeBase(bounds));
|
||||||
widgets.add(Widgets.createLabel(new Point(bounds.x + 26, bounds.getMaxY() - 15), new TranslatableComponent("category.rei.fuel.time", burnTime))
|
widgets.add(Widgets.createLabel(new Point(bounds.x + 26, bounds.getMaxY() - 15), new TranslatableComponent("category.rei.fuel.time", burnTime)).color(0xFF404040, 0xFFBBBBBB).noShadow().leftAligned());
|
||||||
.color(0xFF404040, 0xFFBBBBBB).noShadow().leftAligned());
|
|
||||||
widgets.add(Widgets.createBurningFire(new Point(bounds.x + 6, startPoint.y + 1)).animationDurationTicks(recipeDisplay.getFuelTime()));
|
widgets.add(Widgets.createBurningFire(new Point(bounds.x + 6, startPoint.y + 1)).animationDurationTicks(recipeDisplay.getFuelTime()));
|
||||||
widgets.add(Widgets.createSlot(new Point(bounds.x + 6, startPoint.y + 18)).entries(recipeDisplay.getInputEntries().get(0)).markInput());
|
widgets.add(Widgets.createSlot(new Point(bounds.x + 6, startPoint.y + 18)).entries(recipeDisplay.getInputEntries().get(0)).markInput());
|
||||||
return widgets;
|
return widgets;
|
||||||
|
@ -74,8 +73,7 @@ public class REIAlloyingFuelCategory implements DisplayCategory<REIAlloyingFuelD
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public Tooltip getTooltip(Point point) {
|
public Tooltip getTooltip(Point point) {
|
||||||
if (slot.containsMouse(point))
|
if (slot.containsMouse(point)) return slot.getCurrentTooltip(point);
|
||||||
return slot.getCurrentTooltip(point);
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,8 +72,7 @@ public class REIAnvilCategory implements TransferDisplayCategory<REIAnvilDisplay
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
//materials.forEach(entryStack -> entryStack.setAmount(display.getInputCount()));
|
//materials.forEach(entryStack -> entryStack.setAmount(display.getInputCount()));
|
||||||
widgets.add(Widgets.createArrow(new Point(x + 24, y + 4)));
|
widgets.add(Widgets.createArrow(new Point(x + 24, y + 4)));
|
||||||
widgets.add(Widgets.createLabel(new Point(bounds.x + bounds.width - 7, bounds.y + bounds.height - 15),
|
widgets.add(Widgets.createLabel(new Point(bounds.x + bounds.width - 7, bounds.y + bounds.height - 15), new TranslatableComponent("category.rei.damage.amount&dmg", display.getDamage())).noShadow().rightAligned().color(0xFF404040, 0xFFBBBBBB));
|
||||||
new TranslatableComponent("category.rei.damage.amount&dmg", display.getDamage())).noShadow().rightAligned().color(0xFF404040, 0xFFBBBBBB));
|
|
||||||
widgets.add(Widgets.createSlot(new Point(x - 20, y + 4)).entries(materials).markInput());
|
widgets.add(Widgets.createSlot(new Point(x - 20, y + 4)).entries(materials).markInput());
|
||||||
widgets.add(Widgets.createSlot(new Point(x + 1, y + 4)).entries(inputEntries.get(0)).markInput());
|
widgets.add(Widgets.createSlot(new Point(x + 1, y + 4)).entries(inputEntries.get(0)).markInput());
|
||||||
widgets.add(Widgets.createSlot(new Point(x + 61, y + 5)).entries(display.getOutputEntries().get(0)).disableBackground().markOutput());
|
widgets.add(Widgets.createSlot(new Point(x + 61, y + 5)).entries(display.getOutputEntries().get(0)).disableBackground().markOutput());
|
||||||
|
@ -83,8 +82,7 @@ public class REIAnvilCategory implements TransferDisplayCategory<REIAnvilDisplay
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderRedSlots(PoseStack matrices, List<Widget> widgets, Rectangle bounds, REIAnvilDisplay display,
|
public void renderRedSlots(PoseStack matrices, List<Widget> widgets, Rectangle bounds, REIAnvilDisplay display, IntList redSlots) {
|
||||||
IntList redSlots) {
|
|
||||||
Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
|
Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
|
||||||
matrices.pushPose();
|
matrices.pushPose();
|
||||||
matrices.translate(0, 0, 400);
|
matrices.translate(0, 0, 400);
|
||||||
|
|
|
@ -17,10 +17,7 @@ public class REIAnvilDisplay extends BasicDisplay implements SimpleGridMenuDispl
|
||||||
private final AnvilRecipe recipe;
|
private final AnvilRecipe recipe;
|
||||||
|
|
||||||
public REIAnvilDisplay(AnvilRecipe recipe) {
|
public REIAnvilDisplay(AnvilRecipe recipe) {
|
||||||
super(
|
super(EntryIngredients.ofIngredients(recipe.getIngredients()), Collections.singletonList(EntryIngredients.of(recipe.getResultItem())));
|
||||||
EntryIngredients.ofIngredients(recipe.getIngredients()),
|
|
||||||
Collections.singletonList(EntryIngredients.of(recipe.getResultItem()))
|
|
||||||
);
|
|
||||||
this.recipe = recipe;
|
this.recipe = recipe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,15 +71,7 @@ public class REIInfusionCategory implements TransferDisplayCategory<REIInfusionD
|
||||||
widgets.add(Widgets.createSlot(new Point(centerPoint.x - 24, centerPoint.y + 24)).entries(inputEntries.get(6)).disableBackground().markInput());
|
widgets.add(Widgets.createSlot(new Point(centerPoint.x - 24, centerPoint.y + 24)).entries(inputEntries.get(6)).disableBackground().markInput());
|
||||||
widgets.add(Widgets.createSlot(new Point(centerPoint.x - 24, centerPoint.y - 24)).entries(inputEntries.get(8)).disableBackground().markInput());
|
widgets.add(Widgets.createSlot(new Point(centerPoint.x - 24, centerPoint.y - 24)).entries(inputEntries.get(8)).disableBackground().markInput());
|
||||||
widgets.add(Widgets.createSlot(new Point(centerPoint.x + 80, centerPoint.y)).entries(outputEntries.get(0)).disableBackground().markOutput());
|
widgets.add(Widgets.createSlot(new Point(centerPoint.x + 80, centerPoint.y)).entries(outputEntries.get(0)).disableBackground().markOutput());
|
||||||
widgets.add(
|
widgets.add(Widgets.createLabel(new Point(bounds.getMaxX() - 5, bounds.y + 6), new TranslatableComponent("category.rei.infusion.time&val", display.getInfusionTime())).noShadow().rightAligned().color(0xFF404040, 0xFFBBBBBB));
|
||||||
Widgets.createLabel(
|
|
||||||
new Point(bounds.getMaxX() - 5, bounds.y + 6),
|
|
||||||
new TranslatableComponent("category.rei.infusion.time&val", display.getInfusionTime())
|
|
||||||
)
|
|
||||||
.noShadow()
|
|
||||||
.rightAligned()
|
|
||||||
.color(0xFF404040, 0xFFBBBBBB)
|
|
||||||
);
|
|
||||||
return widgets;
|
return widgets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,7 @@ public class REIInfusionDisplay extends BasicDisplay implements SimpleGridMenuDi
|
||||||
private final int time;
|
private final int time;
|
||||||
|
|
||||||
public REIInfusionDisplay(InfusionRecipe recipe) {
|
public REIInfusionDisplay(InfusionRecipe recipe) {
|
||||||
super(
|
super(EntryIngredients.ofIngredients(recipe.getIngredients()), Collections.singletonList(EntryIngredients.of(recipe.getResultItem())));
|
||||||
EntryIngredients.ofIngredients(recipe.getIngredients()),
|
|
||||||
Collections.singletonList(EntryIngredients.of(recipe.getResultItem()))
|
|
||||||
);
|
|
||||||
this.recipe = recipe;
|
this.recipe = recipe;
|
||||||
this.time = recipe.getInfusionTime();
|
this.time = recipe.getInfusionTime();
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,14 +50,11 @@ public class REIPlugin implements REIClientPlugin {
|
||||||
END_STONE_SMELTER = EntryStacks.of(EndBlocks.END_STONE_SMELTER);
|
END_STONE_SMELTER = EntryStacks.of(EndBlocks.END_STONE_SMELTER);
|
||||||
INFUSION_RITUAL = EntryStacks.of(EndBlocks.INFUSION_PEDESTAL);
|
INFUSION_RITUAL = EntryStacks.of(EndBlocks.INFUSION_PEDESTAL);
|
||||||
|
|
||||||
List<EntryStack> anvils = Lists.newArrayList(EntryIngredients.ofItems(EndBlocks.getModBlocks().stream()
|
List<EntryStack> anvils = Lists.newArrayList(EntryIngredients.ofItems(EndBlocks.getModBlocks().stream().filter(EndAnvilBlock.class::isInstance).collect(Collectors.toList())));
|
||||||
.filter(EndAnvilBlock.class::isInstance).collect(Collectors.toList())));
|
|
||||||
anvils.add(0, EntryStacks.of(Blocks.ANVIL));
|
anvils.add(0, EntryStacks.of(Blocks.ANVIL));
|
||||||
ANVILS = anvils.toArray(new EntryStack[0]);
|
ANVILS = anvils.toArray(new EntryStack[0]);
|
||||||
|
|
||||||
FURNACES = Lists.newArrayList(EntryIngredients.ofItems(EndBlocks.getModBlocks().stream()
|
FURNACES = Lists.newArrayList(EntryIngredients.ofItems(EndBlocks.getModBlocks().stream().filter(BaseFurnaceBlock.class::isInstance).collect(Collectors.toList()))).toArray(new EntryStack[0]);
|
||||||
.filter(BaseFurnaceBlock.class::isInstance).collect(Collectors.toList())))
|
|
||||||
.toArray(new EntryStack[0]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -79,12 +76,7 @@ public class REIPlugin implements REIClientPlugin {
|
||||||
public void registerCategories(CategoryRegistry registry) {
|
public void registerCategories(CategoryRegistry registry) {
|
||||||
init();
|
init();
|
||||||
|
|
||||||
registry.add(
|
registry.add(new REIAlloyingFuelCategory(), new REIAlloyingCategory(END_STONE_SMELTER), new REIInfusionCategory(INFUSION_RITUAL), new REIAnvilCategory(ANVILS));
|
||||||
new REIAlloyingFuelCategory(),
|
|
||||||
new REIAlloyingCategory(END_STONE_SMELTER),
|
|
||||||
new REIInfusionCategory(INFUSION_RITUAL),
|
|
||||||
new REIAnvilCategory(ANVILS)
|
|
||||||
);
|
|
||||||
|
|
||||||
registry.addWorkstations(ALLOYING_FUEL, END_STONE_SMELTER);
|
registry.addWorkstations(ALLOYING_FUEL, END_STONE_SMELTER);
|
||||||
registry.addWorkstations(ALLOYING, END_STONE_SMELTER);
|
registry.addWorkstations(ALLOYING, END_STONE_SMELTER);
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
package ru.betterend.interfaces;
|
package ru.betterend.interfaces;
|
||||||
|
|
||||||
public interface BetterEndRecipe {
|
public interface BetterEndRecipe {}
|
||||||
}
|
|
||||||
|
|
3
src/main/java/ru/betterend/interfaces/PottablePlant.java
Normal file
3
src/main/java/ru/betterend/interfaces/PottablePlant.java
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
package ru.betterend.interfaces;
|
||||||
|
|
||||||
|
public interface PottablePlant {}
|
|
@ -27,18 +27,14 @@ public class ArmoredElytra extends BaseArmorItem implements MultiModelItem, Fall
|
||||||
private final int defense;
|
private final int defense;
|
||||||
|
|
||||||
public ArmoredElytra(String name, ArmorMaterial material, Item repairItem, int durability, double movementFactor, boolean fireproof) {
|
public ArmoredElytra(String name, ArmorMaterial material, Item repairItem, int durability, double movementFactor, boolean fireproof) {
|
||||||
super(material, EquipmentSlot.CHEST, fireproof ?
|
super(material, EquipmentSlot.CHEST, fireproof ? EndItems.makeEndItemSettings().durability(durability).rarity(Rarity.EPIC).fireResistant() : EndItems.makeEndItemSettings().durability(durability).rarity(Rarity.EPIC));
|
||||||
EndItems.makeEndItemSettings().durability(durability).rarity(Rarity.EPIC).fireResistant() :
|
|
||||||
EndItems.makeEndItemSettings().durability(durability).rarity(Rarity.EPIC));
|
|
||||||
this.wingTexture = BetterEnd.makeID("textures/entity/" + name + ".png");
|
this.wingTexture = BetterEnd.makeID("textures/entity/" + name + ".png");
|
||||||
this.repairItem = repairItem;
|
this.repairItem = repairItem;
|
||||||
this.movementFactor = movementFactor;
|
this.movementFactor = movementFactor;
|
||||||
this.defense = (int) ((double) material.getDefenseForSlot(EquipmentSlot.CHEST) / 1.75);
|
this.defense = (int) ((double) material.getDefenseForSlot(EquipmentSlot.CHEST) / 1.75);
|
||||||
this.toughness = material.getToughness() / 1.75F;
|
this.toughness = material.getToughness() / 1.75F;
|
||||||
addAttributeModifier(Attributes.ARMOR, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2],
|
addAttributeModifier(Attributes.ARMOR, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2], "Armor modifier", defense, AttributeModifier.Operation.ADDITION));
|
||||||
"Armor modifier", defense, AttributeModifier.Operation.ADDITION));
|
addAttributeModifier(Attributes.ARMOR_TOUGHNESS, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2], "Armor toughness", toughness, AttributeModifier.Operation.ADDITION));
|
||||||
addAttributeModifier(Attributes.ARMOR_TOUGHNESS, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2],
|
|
||||||
"Armor toughness", toughness, AttributeModifier.Operation.ADDITION));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -70,7 +66,6 @@ public class ArmoredElytra extends BaseArmorItem implements MultiModelItem, Fall
|
||||||
@Override
|
@Override
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public void registerModelPredicate() {
|
public void registerModelPredicate() {
|
||||||
FabricModelPredicateProviderRegistry.register(this, new ResourceLocation("broken"),
|
FabricModelPredicateProviderRegistry.register(this, new ResourceLocation("broken"), (itemStack, clientLevel, livingEntity, id) -> ElytraItem.isFlyEnabled(itemStack) ? 0.0F : 1.0F);
|
||||||
(itemStack, clientLevel, livingEntity, id) -> ElytraItem.isFlyEnabled(itemStack) ? 0.0F : 1.0F);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,10 +28,8 @@ public class CrystaliteElytra extends CrystaliteArmor implements MultiModelItem,
|
||||||
this.movementFactor = movementFactor;
|
this.movementFactor = movementFactor;
|
||||||
this.defense = (int) ((double) material.getDefenseForSlot(EquipmentSlot.CHEST) / 1.75);
|
this.defense = (int) ((double) material.getDefenseForSlot(EquipmentSlot.CHEST) / 1.75);
|
||||||
this.toughness = material.getToughness() / 1.75F;
|
this.toughness = material.getToughness() / 1.75F;
|
||||||
addAttributeModifier(Attributes.ARMOR, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2],
|
addAttributeModifier(Attributes.ARMOR, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2], "Armor modifier", defense, AttributeModifier.Operation.ADDITION));
|
||||||
"Armor modifier", defense, AttributeModifier.Operation.ADDITION));
|
addAttributeModifier(Attributes.ARMOR_TOUGHNESS, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2], "Armor toughness", toughness, AttributeModifier.Operation.ADDITION));
|
||||||
addAttributeModifier(Attributes.ARMOR_TOUGHNESS, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2],
|
|
||||||
"Armor toughness", toughness, AttributeModifier.Operation.ADDITION));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -62,7 +60,6 @@ public class CrystaliteElytra extends CrystaliteArmor implements MultiModelItem,
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerModelPredicate() {
|
public void registerModelPredicate() {
|
||||||
FabricModelPredicateProviderRegistry.register(this, new ResourceLocation("broken"),
|
FabricModelPredicateProviderRegistry.register(this, new ResourceLocation("broken"), (itemStack, clientLevel, livingEntity, i) -> ElytraItem.isFlyEnabled(itemStack) ? 0.0F : 1.0F);
|
||||||
(itemStack, clientLevel, livingEntity, i) -> ElytraItem.isFlyEnabled(itemStack) ? 0.0F : 1.0F);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,12 +14,7 @@ import java.util.UUID;
|
||||||
|
|
||||||
public class EndArmorItem extends ArmorItem implements ItemModelProvider {
|
public class EndArmorItem extends ArmorItem implements ItemModelProvider {
|
||||||
|
|
||||||
protected static final UUID[] ARMOR_MODIFIER_UUID_PER_SLOT = new UUID[]{
|
protected static final UUID[] ARMOR_MODIFIER_UUID_PER_SLOT = new UUID[]{UUID.fromString("845DB27C-C624-495F-8C9F-6020A9A58B6B"), UUID.fromString("D8499B04-0E66-4726-AB29-64469D734E0D"), UUID.fromString("9F3D476D-C118-4544-8365-64846904B48E"), UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150")};
|
||||||
UUID.fromString("845DB27C-C624-495F-8C9F-6020A9A58B6B"),
|
|
||||||
UUID.fromString("D8499B04-0E66-4726-AB29-64469D734E0D"),
|
|
||||||
UUID.fromString("9F3D476D-C118-4544-8365-64846904B48E"),
|
|
||||||
UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150")
|
|
||||||
};
|
|
||||||
|
|
||||||
protected final Multimap<Attribute, AttributeModifier> defaultModifiers;
|
protected final Multimap<Attribute, AttributeModifier> defaultModifiers;
|
||||||
|
|
||||||
|
|
|
@ -16,14 +16,11 @@ import java.util.function.Supplier;
|
||||||
public enum EndArmorMaterial implements ArmorMaterial {
|
public enum EndArmorMaterial implements ArmorMaterial {
|
||||||
THALLASIUM("thallasium", 17, new int[]{1, 4, 5, 2}, 12, SoundEvents.ARMOR_EQUIP_IRON, 0.0F, 0.0F, () -> {
|
THALLASIUM("thallasium", 17, new int[]{1, 4, 5, 2}, 12, SoundEvents.ARMOR_EQUIP_IRON, 0.0F, 0.0F, () -> {
|
||||||
return Ingredient.of(EndBlocks.THALLASIUM.ingot);
|
return Ingredient.of(EndBlocks.THALLASIUM.ingot);
|
||||||
}),
|
}), TERMINITE("terminite", 26, new int[]{3, 6, 7, 3}, 14, SoundEvents.ARMOR_EQUIP_IRON, 1.0F, 0.05F, () -> {
|
||||||
TERMINITE("terminite", 26, new int[]{3, 6, 7, 3}, 14, SoundEvents.ARMOR_EQUIP_IRON, 1.0F, 0.05F, () -> {
|
|
||||||
return Ingredient.of(EndBlocks.TERMINITE.ingot);
|
return Ingredient.of(EndBlocks.TERMINITE.ingot);
|
||||||
}),
|
}), AETERNIUM("aeternium", 40, new int[]{4, 7, 9, 4}, 18, SoundEvents.ARMOR_EQUIP_NETHERITE, 3.5F, 0.2F, () -> {
|
||||||
AETERNIUM("aeternium", 40, new int[]{4, 7, 9, 4}, 18, SoundEvents.ARMOR_EQUIP_NETHERITE, 3.5F, 0.2F, () -> {
|
|
||||||
return Ingredient.of(EndItems.AETERNIUM_INGOT);
|
return Ingredient.of(EndItems.AETERNIUM_INGOT);
|
||||||
}),
|
}), CRYSTALITE("crystalite", 30, new int[]{3, 6, 8, 3}, 24, SoundEvents.ARMOR_EQUIP_DIAMOND, 1.2F, 0.1F, () -> {
|
||||||
CRYSTALITE("crystalite", 30, new int[]{3, 6, 8, 3}, 24, SoundEvents.ARMOR_EQUIP_DIAMOND, 1.2F, 0.1F, () -> {
|
|
||||||
return Ingredient.of(EndBlocks.TERMINITE.ingot);
|
return Ingredient.of(EndBlocks.TERMINITE.ingot);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -37,9 +34,7 @@ public enum EndArmorMaterial implements ArmorMaterial {
|
||||||
private final float knockbackResistance;
|
private final float knockbackResistance;
|
||||||
private final LazyLoadedValue<Ingredient> repairIngredient;
|
private final LazyLoadedValue<Ingredient> repairIngredient;
|
||||||
|
|
||||||
private EndArmorMaterial(String name, int durabilityMultiplier, int[] protectionAmounts, int enchantability,
|
private EndArmorMaterial(String name, int durabilityMultiplier, int[] protectionAmounts, int enchantability, SoundEvent equipSound, float toughness, float knockbackResistance, Supplier<Ingredient> repairIngredient) {
|
||||||
SoundEvent equipSound, float toughness, float knockbackResistance,
|
|
||||||
Supplier<Ingredient> repairIngredient) {
|
|
||||||
|
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.durabilityMultiplier = durabilityMultiplier;
|
this.durabilityMultiplier = durabilityMultiplier;
|
||||||
|
|
|
@ -11,11 +11,9 @@ import java.util.function.Supplier;
|
||||||
public enum EndToolMaterial implements Tier {
|
public enum EndToolMaterial implements Tier {
|
||||||
THALLASIUM(2, 320, 7.0F, 1.5F, 12, () -> {
|
THALLASIUM(2, 320, 7.0F, 1.5F, 12, () -> {
|
||||||
return Ingredient.of(EndBlocks.THALLASIUM.ingot);
|
return Ingredient.of(EndBlocks.THALLASIUM.ingot);
|
||||||
}),
|
}), TERMINITE(3, 1230, 8.5F, 3.0F, 14, () -> {
|
||||||
TERMINITE(3, 1230, 8.5F, 3.0F, 14, () -> {
|
|
||||||
return Ingredient.of(EndBlocks.TERMINITE.ingot);
|
return Ingredient.of(EndBlocks.TERMINITE.ingot);
|
||||||
}),
|
}), AETERNIUM(5, 2196, 10.0F, 4.5F, 18, () -> {
|
||||||
AETERNIUM(5, 2196, 10.0F, 4.5F, 18, () -> {
|
|
||||||
return Ingredient.of(EndItems.AETERNIUM_INGOT);
|
return Ingredient.of(EndItems.AETERNIUM_INGOT);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -26,8 +24,7 @@ public enum EndToolMaterial implements Tier {
|
||||||
private final int enchantability;
|
private final int enchantability;
|
||||||
private final LazyLoadedValue<Ingredient> repairIngredient;
|
private final LazyLoadedValue<Ingredient> repairIngredient;
|
||||||
|
|
||||||
private EndToolMaterial(int miningLevel, int durability, float miningSpeed, float attackDamage, int enchantability,
|
private EndToolMaterial(int miningLevel, int durability, float miningSpeed, float attackDamage, int enchantability, Supplier<Ingredient> repairIngredient) {
|
||||||
Supplier<Ingredient> repairIngredient) {
|
|
||||||
|
|
||||||
this.durability = durability;
|
this.durability = durability;
|
||||||
this.miningSpeed = miningSpeed;
|
this.miningSpeed = miningSpeed;
|
||||||
|
|
|
@ -20,16 +20,9 @@ public class ArmoredElytraModel<T extends LivingEntity> extends AgeableListModel
|
||||||
public static LayerDefinition getTexturedModelData() {
|
public static LayerDefinition getTexturedModelData() {
|
||||||
MeshDefinition modelData = new MeshDefinition();
|
MeshDefinition modelData = new MeshDefinition();
|
||||||
PartDefinition modelPartData = modelData.getRoot();
|
PartDefinition modelPartData = modelData.getRoot();
|
||||||
modelPartData.addOrReplaceChild(PartNames.LEFT_WING, CubeListBuilder.create()
|
modelPartData.addOrReplaceChild(PartNames.LEFT_WING, CubeListBuilder.create().texOffs(22, 0).addBox(-10.0f, 0.0f, 0.0f, 10.0f, 20.0f, 2.0f), PartPose.ZERO);
|
||||||
.texOffs(22, 0)
|
|
||||||
.addBox(-10.0f, 0.0f, 0.0f, 10.0f, 20.0f, 2.0f),
|
|
||||||
PartPose.ZERO);
|
|
||||||
|
|
||||||
modelPartData.addOrReplaceChild(PartNames.RIGHT_WING, CubeListBuilder.create()
|
modelPartData.addOrReplaceChild(PartNames.RIGHT_WING, CubeListBuilder.create().mirror().texOffs(22, 0).addBox(0.0f, 0.0f, 0.0f, 10.0f, 20.0f, 2.0f), PartPose.ZERO);
|
||||||
.mirror()
|
|
||||||
.texOffs(22, 0)
|
|
||||||
.addBox(0.0f, 0.0f, 0.0f, 10.0f, 20.0f, 2.0f),
|
|
||||||
PartPose.ZERO);
|
|
||||||
|
|
||||||
return LayerDefinition.create(modelData, 64, 32);
|
return LayerDefinition.create(modelData, 64, 32);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,24 +28,21 @@ public class CrystaliteArmorProvider implements ArmorRenderingRegistry.ModelProv
|
||||||
private final static CrystaliteBootsModel BOOTS_MODEL = CrystaliteBootsModel.createModel(null);
|
private final static CrystaliteBootsModel BOOTS_MODEL = CrystaliteBootsModel.createModel(null);
|
||||||
|
|
||||||
//@Override
|
//@Override
|
||||||
public @NotNull ResourceLocation getArmorTexture(LivingEntity entity, ItemStack stack, EquipmentSlot slot,
|
public @NotNull ResourceLocation getArmorTexture(LivingEntity entity, ItemStack stack, EquipmentSlot slot, boolean secondLayer, @Nullable String suffix, ResourceLocation defaultTexture) {
|
||||||
boolean secondLayer, @Nullable String suffix, ResourceLocation defaultTexture) {
|
|
||||||
if (!isStackValid(stack)) return defaultTexture;
|
if (!isStackValid(stack)) return defaultTexture;
|
||||||
if (secondLayer) return SECOND_LAYER;
|
if (secondLayer) return SECOND_LAYER;
|
||||||
return FIRST_LAYER;
|
return FIRST_LAYER;
|
||||||
}
|
}
|
||||||
|
|
||||||
//@Override
|
//@Override
|
||||||
public @NotNull HumanoidModel<LivingEntity> getArmorModel(LivingEntity entity, ItemStack stack,
|
public @NotNull HumanoidModel<LivingEntity> getArmorModel(LivingEntity entity, ItemStack stack, EquipmentSlot slot, HumanoidModel<LivingEntity> defaultModel) {
|
||||||
EquipmentSlot slot, HumanoidModel<LivingEntity> defaultModel) {
|
|
||||||
if (!isStackValid(stack)) return defaultModel;
|
if (!isStackValid(stack)) return defaultModel;
|
||||||
switch (slot) {
|
switch (slot) {
|
||||||
case HEAD: {
|
case HEAD: {
|
||||||
return HELMET_MODEL;
|
return HELMET_MODEL;
|
||||||
}
|
}
|
||||||
case CHEST: {
|
case CHEST: {
|
||||||
if (entity instanceof AbstractClientPlayer &&
|
if (entity instanceof AbstractClientPlayer && ((AbstractClientPlayer) entity).getModelName().equals("slim")) {
|
||||||
((AbstractClientPlayer) entity).getModelName().equals("slim")) {
|
|
||||||
CHEST_MODEL_SLIM.copyPropertiesTo(defaultModel);
|
CHEST_MODEL_SLIM.copyPropertiesTo(defaultModel);
|
||||||
return CHEST_MODEL_SLIM;
|
return CHEST_MODEL_SLIM;
|
||||||
}
|
}
|
||||||
|
@ -66,12 +63,7 @@ public class CrystaliteArmorProvider implements ArmorRenderingRegistry.ModelProv
|
||||||
}
|
}
|
||||||
|
|
||||||
public Iterable<Item> getRenderedItems() {
|
public Iterable<Item> getRenderedItems() {
|
||||||
return Lists.newArrayList(
|
return Lists.newArrayList(EndItems.CRYSTALITE_HELMET, EndItems.CRYSTALITE_CHESTPLATE, EndItems.CRYSTALITE_ELYTRA, EndItems.CRYSTALITE_LEGGINGS, EndItems.CRYSTALITE_BOOTS);
|
||||||
EndItems.CRYSTALITE_HELMET,
|
|
||||||
EndItems.CRYSTALITE_CHESTPLATE,
|
|
||||||
EndItems.CRYSTALITE_ELYTRA,
|
|
||||||
EndItems.CRYSTALITE_LEGGINGS,
|
|
||||||
EndItems.CRYSTALITE_BOOTS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isStackValid(ItemStack stack) {
|
private boolean isStackValid(ItemStack stack) {
|
||||||
|
|
|
@ -38,15 +38,9 @@ public class CrystaliteBootsModel extends HumanoidModel<LivingEntity> {
|
||||||
modelPartData.addOrReplaceChild("left_leg", CubeListBuilder.create(), PartPose.ZERO);
|
modelPartData.addOrReplaceChild("left_leg", CubeListBuilder.create(), PartPose.ZERO);
|
||||||
|
|
||||||
CubeDeformation deformation = new CubeDeformation(scale + 0.25f);
|
CubeDeformation deformation = new CubeDeformation(scale + 0.25f);
|
||||||
modelPartData.addOrReplaceChild("leftBoot", CubeListBuilder.create()
|
modelPartData.addOrReplaceChild("leftBoot", CubeListBuilder.create().texOffs(0, 32).addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), PartPose.offset(1.9f, 12.0f, 0.0f));
|
||||||
.texOffs(0, 32)
|
|
||||||
.addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation),
|
|
||||||
PartPose.offset(1.9f, 12.0f, 0.0f));
|
|
||||||
|
|
||||||
modelPartData.addOrReplaceChild("rightBoot", CubeListBuilder.create()
|
modelPartData.addOrReplaceChild("rightBoot", CubeListBuilder.create().texOffs(0, 16).addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), PartPose.offset(-1.9f, 12.0f, 0.0f));
|
||||||
.texOffs(0, 16)
|
|
||||||
.addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation),
|
|
||||||
PartPose.offset(-1.9f, 12.0f, 0.0f));
|
|
||||||
|
|
||||||
return LayerDefinition.create(modelData, 64, 48);
|
return LayerDefinition.create(modelData, 64, 48);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,36 +49,19 @@ public class CrystaliteChestplateModel extends HumanoidModel<LivingEntity> {
|
||||||
modelPartData.addOrReplaceChild("left_leg", CubeListBuilder.create(), PartPose.ZERO);
|
modelPartData.addOrReplaceChild("left_leg", CubeListBuilder.create(), PartPose.ZERO);
|
||||||
|
|
||||||
CubeDeformation deformation = new CubeDeformation(scale + 0.25F);
|
CubeDeformation deformation = new CubeDeformation(scale + 0.25F);
|
||||||
PartDefinition body = modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create()
|
PartDefinition body = modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create().texOffs(16, 16).addBox(-4.0f, 0.0f, -2.0f, 8.0f, 12.0f, 4.0f, deformation), PartPose.ZERO);
|
||||||
.texOffs(16, 16)
|
|
||||||
.addBox(-4.0f, 0.0f, -2.0f, 8.0f, 12.0f, 4.0f, deformation),
|
|
||||||
PartPose.ZERO);
|
|
||||||
|
|
||||||
if (thinArms) {
|
if (thinArms) {
|
||||||
deformation = new CubeDeformation(scale + 0.45F);
|
deformation = new CubeDeformation(scale + 0.45F);
|
||||||
PartDefinition leftShoulder = modelPartData.addOrReplaceChild("leftShoulder", CubeListBuilder.create()
|
PartDefinition leftShoulder = modelPartData.addOrReplaceChild("leftShoulder", CubeListBuilder.create().mirror().texOffs(40, 32).addBox(-1.0f, -2.5f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), PartPose.offset(5.0f, 2.0f, 0.0f));
|
||||||
.mirror()
|
|
||||||
.texOffs(40, 32)
|
|
||||||
.addBox(-1.0f, -2.5f, -2.0f, 4.0f, 12.0f, 4.0f, deformation),
|
|
||||||
PartPose.offset(5.0f, 2.0f, 0.0f));
|
|
||||||
|
|
||||||
PartDefinition rightShoulder = modelPartData.addOrReplaceChild("rightShoulder", CubeListBuilder.create()
|
PartDefinition rightShoulder = modelPartData.addOrReplaceChild("rightShoulder", CubeListBuilder.create().texOffs(40, 16).addBox(-3.0f, -2.5f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), PartPose.offset(-5.0f, 2.0f, 10.0f));
|
||||||
.texOffs(40, 16)
|
|
||||||
.addBox(-3.0f, -2.5f, -2.0f, 4.0f, 12.0f, 4.0f, deformation),
|
|
||||||
PartPose.offset(-5.0f, 2.0f, 10.0f));
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
deformation = new CubeDeformation(scale + 0.45F);
|
deformation = new CubeDeformation(scale + 0.45F);
|
||||||
PartDefinition leftShoulder = modelPartData.addOrReplaceChild("leftShoulder", CubeListBuilder.create()
|
PartDefinition leftShoulder = modelPartData.addOrReplaceChild("leftShoulder", CubeListBuilder.create().mirror().texOffs(40, 32).addBox(-1.0f, -2.5f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), PartPose.offset(5.0f, 2.0f, 0.0f));
|
||||||
.mirror()
|
|
||||||
.texOffs(40, 32)
|
|
||||||
.addBox(-1.0f, -2.5f, -2.0f, 4.0f, 12.0f, 4.0f, deformation),
|
|
||||||
PartPose.offset(5.0f, 2.0f, 0.0f));
|
|
||||||
|
|
||||||
PartDefinition rightShoulder = modelPartData.addOrReplaceChild("rightShoulder", CubeListBuilder.create()
|
PartDefinition rightShoulder = modelPartData.addOrReplaceChild("rightShoulder", CubeListBuilder.create().texOffs(40, 16).addBox(-3.0f, -2.5f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), PartPose.offset(-5.0f, 2.0f, 10.0f));
|
||||||
.texOffs(40, 16)
|
|
||||||
.addBox(-3.0f, -2.5f, -2.0f, 4.0f, 12.0f, 4.0f, deformation),
|
|
||||||
PartPose.offset(-5.0f, 2.0f, 10.0f));
|
|
||||||
}
|
}
|
||||||
return LayerDefinition.create(modelData, 64, 48);
|
return LayerDefinition.create(modelData, 64, 48);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,10 +40,7 @@ public class CrystaliteHelmetModel extends HumanoidModel<LivingEntity> {
|
||||||
modelPartData.addOrReplaceChild("left_leg", CubeListBuilder.create(), PartPose.ZERO);
|
modelPartData.addOrReplaceChild("left_leg", CubeListBuilder.create(), PartPose.ZERO);
|
||||||
|
|
||||||
CubeDeformation deformation_hat = new CubeDeformation(scale + 0.5f);
|
CubeDeformation deformation_hat = new CubeDeformation(scale + 0.5f);
|
||||||
PartDefinition hat = modelPartData.addOrReplaceChild(PartNames.HAT, CubeListBuilder.create()
|
PartDefinition hat = modelPartData.addOrReplaceChild(PartNames.HAT, CubeListBuilder.create().texOffs(0, 0).addBox(-4.0f, -8.0f, -4.0f, 8.0f, 8.0f, 8.0f, deformation_hat), PartPose.ZERO);
|
||||||
.texOffs(0, 0)
|
|
||||||
.addBox(-4.0f, -8.0f, -4.0f, 8.0f, 8.0f, 8.0f, deformation_hat),
|
|
||||||
PartPose.ZERO);
|
|
||||||
|
|
||||||
return LayerDefinition.create(modelData, 64, 48);
|
return LayerDefinition.create(modelData, 64, 48);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,20 +35,11 @@ public class CrystaliteLeggingsModel extends HumanoidModel<LivingEntity> {
|
||||||
// modelPartData.addOrReplaceChild("left_leg", CubeListBuilder.create(), PartPose.ZERO);
|
// modelPartData.addOrReplaceChild("left_leg", CubeListBuilder.create(), PartPose.ZERO);
|
||||||
|
|
||||||
CubeDeformation deformation = new CubeDeformation(scale);
|
CubeDeformation deformation = new CubeDeformation(scale);
|
||||||
modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create()
|
modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create().texOffs(16, 16).addBox(-4.0f, 0.0f, -2.0f, 8.0f, 12.0f, 4.0f, deformation), PartPose.ZERO);
|
||||||
.texOffs(16, 16)
|
|
||||||
.addBox(-4.0f, 0.0f, -2.0f, 8.0f, 12.0f, 4.0f, deformation),
|
|
||||||
PartPose.ZERO);
|
|
||||||
|
|
||||||
modelPartData.addOrReplaceChild(PartNames.LEFT_LEG, CubeListBuilder.create()
|
modelPartData.addOrReplaceChild(PartNames.LEFT_LEG, CubeListBuilder.create().texOffs(0, 32).addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), PartPose.offset(1.9f, 12.0f, 0.0f));
|
||||||
.texOffs(0, 32)
|
|
||||||
.addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation),
|
|
||||||
PartPose.offset(1.9f, 12.0f, 0.0f));
|
|
||||||
|
|
||||||
modelPartData.addOrReplaceChild(PartNames.RIGHT_LEG, CubeListBuilder.create()
|
modelPartData.addOrReplaceChild(PartNames.RIGHT_LEG, CubeListBuilder.create().texOffs(0, 16).addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), PartPose.offset(-1.9f, 12.0f, 0.0f));
|
||||||
.texOffs(0, 16)
|
|
||||||
.addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation),
|
|
||||||
PartPose.offset(-1.9f, 12.0f, 0.0f));
|
|
||||||
|
|
||||||
return LayerDefinition.create(modelData, 64, 48);
|
return LayerDefinition.create(modelData, 64, 48);
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,12 +51,7 @@ public class EndHammerItem extends DiggerItem implements DynamicAttributeTool, I
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canAttackBlock(BlockState state, Level world, BlockPos pos, Player miner) {
|
public boolean canAttackBlock(BlockState state, Level world, BlockPos pos, Player miner) {
|
||||||
return state.getMaterial().equals(Material.STONE) ||
|
return state.getMaterial().equals(Material.STONE) || state.getMaterial().equals(Material.GLASS) || state.is(Blocks.DIAMOND_BLOCK) || state.is(Blocks.EMERALD_BLOCK) || state.is(Blocks.LAPIS_BLOCK) || state.is(Blocks.REDSTONE_BLOCK);
|
||||||
state.getMaterial().equals(Material.GLASS) ||
|
|
||||||
state.is(Blocks.DIAMOND_BLOCK) ||
|
|
||||||
state.is(Blocks.EMERALD_BLOCK) ||
|
|
||||||
state.is(Blocks.LAPIS_BLOCK) ||
|
|
||||||
state.is(Blocks.REDSTONE_BLOCK);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -31,8 +31,7 @@ public class AnvilScreenMixin extends ItemCombinerScreen<AnvilMenu> {
|
||||||
|
|
||||||
private final List<AbstractWidget> be_buttons = Lists.newArrayList();
|
private final List<AbstractWidget> be_buttons = Lists.newArrayList();
|
||||||
|
|
||||||
public AnvilScreenMixin(AnvilMenu handler, Inventory playerInventory, Component title,
|
public AnvilScreenMixin(AnvilMenu handler, Inventory playerInventory, Component title, ResourceLocation texture) {
|
||||||
ResourceLocation texture) {
|
|
||||||
super(handler, playerInventory, title, texture);
|
super(handler, playerInventory, title, texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,13 +5,11 @@ import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.BiomeColors;
|
import net.minecraft.client.renderer.BiomeColors;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||||
import net.minecraft.core.Direction;
|
|
||||||
import net.minecraft.world.level.BlockAndTintGetter;
|
import net.minecraft.world.level.BlockAndTintGetter;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
import ru.bclib.util.BlocksHelper;
|
|
||||||
import ru.bclib.util.ColorUtil;
|
import ru.bclib.util.ColorUtil;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.client.ClientOptions;
|
import ru.betterend.client.ClientOptions;
|
||||||
|
|
|
@ -29,9 +29,7 @@ public abstract class LocalPlayerMixin extends AbstractClientPlayer {
|
||||||
@Shadow
|
@Shadow
|
||||||
public ClientPacketListener connection;
|
public ClientPacketListener connection;
|
||||||
|
|
||||||
@Inject(method = "aiStep", at = @At(value = "INVOKE",
|
@Inject(method = "aiStep", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;getItemBySlot(Lnet/minecraft/world/entity/EquipmentSlot;)Lnet/minecraft/world/item/ItemStack;", shift = Shift.AFTER))
|
||||||
target = "Lnet/minecraft/client/player/LocalPlayer;getItemBySlot(Lnet/minecraft/world/entity/EquipmentSlot;)Lnet/minecraft/world/item/ItemStack;",
|
|
||||||
shift = Shift.AFTER))
|
|
||||||
public void be_aiStep(CallbackInfo info) {
|
public void be_aiStep(CallbackInfo info) {
|
||||||
ItemStack itemStack = getItemBySlot(EquipmentSlot.CHEST);
|
ItemStack itemStack = getItemBySlot(EquipmentSlot.CHEST);
|
||||||
if (itemStack.getItem() instanceof FallFlyingItem && ElytraItem.isFlyEnabled(itemStack) && tryToStartFallFlying()) {
|
if (itemStack.getItem() instanceof FallFlyingItem && ElytraItem.isFlyEnabled(itemStack) && tryToStartFallFlying()) {
|
||||||
|
|
|
@ -1,15 +1,11 @@
|
||||||
package ru.betterend.mixin.client;
|
package ru.betterend.mixin.client;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.color.block.BlockColors;
|
|
||||||
import net.minecraft.client.color.item.ItemColors;
|
|
||||||
import net.minecraft.client.gui.Gui;
|
import net.minecraft.client.gui.Gui;
|
||||||
import net.minecraft.client.gui.screens.Screen;
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
import net.minecraft.client.gui.screens.WinScreen;
|
import net.minecraft.client.gui.screens.WinScreen;
|
||||||
import net.minecraft.client.main.GameConfig;
|
|
||||||
import net.minecraft.client.multiplayer.ClientLevel;
|
import net.minecraft.client.multiplayer.ClientLevel;
|
||||||
import net.minecraft.client.player.LocalPlayer;
|
import net.minecraft.client.player.LocalPlayer;
|
||||||
import net.minecraft.core.Registry;
|
|
||||||
import net.minecraft.sounds.Music;
|
import net.minecraft.sounds.Music;
|
||||||
import net.minecraft.sounds.Musics;
|
import net.minecraft.sounds.Musics;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
|
@ -18,9 +14,7 @@ import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
import ru.bclib.interfaces.IColorProvider;
|
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
|
|
||||||
@Mixin(Minecraft.class)
|
@Mixin(Minecraft.class)
|
||||||
|
@ -38,25 +32,6 @@ public class MinecraftClientMixin {
|
||||||
@Shadow
|
@Shadow
|
||||||
public ClientLevel level;
|
public ClientLevel level;
|
||||||
|
|
||||||
@Final
|
|
||||||
@Shadow
|
|
||||||
private BlockColors blockColors;
|
|
||||||
|
|
||||||
@Final
|
|
||||||
@Shadow
|
|
||||||
private ItemColors itemColors;
|
|
||||||
|
|
||||||
@Inject(method = "<init>*", at = @At("TAIL"))
|
|
||||||
private void be_onInit(GameConfig args, CallbackInfo info) {
|
|
||||||
Registry.BLOCK.forEach(block -> {
|
|
||||||
if (block instanceof IColorProvider) {
|
|
||||||
IColorProvider provider = (IColorProvider) block;
|
|
||||||
blockColors.register(provider.getProvider(), block);
|
|
||||||
itemColors.register(provider.getItemProvider(), block.asItem());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Inject(method = "getSituationalMusic", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "getSituationalMusic", at = @At("HEAD"), cancellable = true)
|
||||||
private void be_getEndMusic(CallbackInfoReturnable<Music> info) {
|
private void be_getEndMusic(CallbackInfoReturnable<Music> info) {
|
||||||
if (!(this.screen instanceof WinScreen) && this.player != null) {
|
if (!(this.screen instanceof WinScreen) && this.player != null) {
|
||||||
|
@ -65,7 +40,7 @@ public class MinecraftClientMixin {
|
||||||
info.setReturnValue(Musics.END_BOSS);
|
info.setReturnValue(Musics.END_BOSS);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Music sound = (Music) this.level.getBiomeManager().getNoiseBiomeAtPosition(this.player.blockPosition()).getBackgroundMusic().orElse(Musics.END);
|
Music sound = this.level.getBiomeManager().getNoiseBiomeAtPosition(this.player.blockPosition()).getBackgroundMusic().orElse(Musics.END);
|
||||||
info.setReturnValue(sound);
|
info.setReturnValue(sound);
|
||||||
}
|
}
|
||||||
info.cancel();
|
info.cancel();
|
||||||
|
|
|
@ -12,9 +12,7 @@ public abstract class ModelLoaderMixin {
|
||||||
|
|
||||||
@ModifyVariable(method = "loadModel", ordinal = 2, at = @At(value = "INVOKE"))
|
@ModifyVariable(method = "loadModel", ordinal = 2, at = @At(value = "INVOKE"))
|
||||||
public ResourceLocation be_switchModel(ResourceLocation id) {
|
public ResourceLocation be_switchModel(ResourceLocation id) {
|
||||||
if (GeneratorOptions.changeChorusPlant() && id.getNamespace().equals("minecraft") &&
|
if (GeneratorOptions.changeChorusPlant() && id.getNamespace().equals("minecraft") && id.getPath().startsWith("blockstates/") && id.getPath().contains("chorus") && !id.getPath().contains("custom_")) {
|
||||||
id.getPath().startsWith("blockstates/") && id.getPath().contains("chorus") &&
|
|
||||||
!id.getPath().contains("custom_")) {
|
|
||||||
id = new ResourceLocation(id.getPath().replace("chorus", "custom_chorus"));
|
id = new ResourceLocation(id.getPath().replace("chorus", "custom_chorus"));
|
||||||
}
|
}
|
||||||
return id;
|
return id;
|
||||||
|
|
|
@ -97,8 +97,7 @@ public abstract class AnvilMenuMixin extends ItemCombinerMenu implements AnvilSc
|
||||||
be_recipes = recipeManager.getRecipesFor(AnvilRecipe.TYPE, inputSlots, player.level);
|
be_recipes = recipeManager.getRecipesFor(AnvilRecipe.TYPE, inputSlots, player.level);
|
||||||
if (be_recipes.size() > 0) {
|
if (be_recipes.size() > 0) {
|
||||||
int anvilLevel = this.anvilLevel.get();
|
int anvilLevel = this.anvilLevel.get();
|
||||||
be_recipes = be_recipes.stream().filter(recipe ->
|
be_recipes = be_recipes.stream().filter(recipe -> anvilLevel >= recipe.getAnvilLevel()).collect(Collectors.toList());
|
||||||
anvilLevel >= recipe.getAnvilLevel()).collect(Collectors.toList());
|
|
||||||
if (be_recipes.size() > 0) {
|
if (be_recipes.size() > 0) {
|
||||||
if (be_currentRecipe == null || !be_recipes.contains(be_currentRecipe)) {
|
if (be_currentRecipe == null || !be_recipes.contains(be_currentRecipe)) {
|
||||||
be_currentRecipe = be_recipes.get(0);
|
be_currentRecipe = be_recipes.get(0);
|
||||||
|
|
|
@ -61,10 +61,7 @@ public abstract class ChorusPlantBlockMixin extends Block {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "Lnet/minecraft/world/level/block/ChorusPlantBlock;getStateForPlacement" +
|
@Inject(method = "Lnet/minecraft/world/level/block/ChorusPlantBlock;getStateForPlacement" + "(Lnet/minecraft/world/level/BlockGetter;Lnet/minecraft/core/BlockPos;)" + "Lnet/minecraft/world/level/block/state/BlockState;", at = @At("RETURN"), cancellable = true)
|
||||||
"(Lnet/minecraft/world/level/BlockGetter;Lnet/minecraft/core/BlockPos;)" +
|
|
||||||
"Lnet/minecraft/world/level/block/state/BlockState;",
|
|
||||||
at = @At("RETURN"), cancellable = true)
|
|
||||||
private void be_getStateForPlacement(BlockGetter blockGetter, BlockPos blockPos, CallbackInfoReturnable<BlockState> info) {
|
private void be_getStateForPlacement(BlockGetter blockGetter, BlockPos blockPos, CallbackInfoReturnable<BlockState> info) {
|
||||||
BlockState plant = info.getReturnValue();
|
BlockState plant = info.getReturnValue();
|
||||||
if (plant.is(Blocks.CHORUS_PLANT)) {
|
if (plant.is(Blocks.CHORUS_PLANT)) {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue