添加lod
This commit is contained in:
parent
565aef410c
commit
3e72c22bf9
9 changed files with 13142 additions and 18 deletions
|
@ -2,7 +2,9 @@ package com.atsuishio.superbwarfare.client.model.entity;
|
||||||
|
|
||||||
import com.atsuishio.superbwarfare.ModUtils;
|
import com.atsuishio.superbwarfare.ModUtils;
|
||||||
import com.atsuishio.superbwarfare.entity.vehicle.Ah6Entity;
|
import com.atsuishio.superbwarfare.entity.vehicle.Ah6Entity;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
import software.bernie.geckolib.model.GeoModel;
|
import software.bernie.geckolib.model.GeoModel;
|
||||||
|
|
||||||
public class Ah6Model extends GeoModel<Ah6Entity> {
|
public class Ah6Model extends GeoModel<Ah6Entity> {
|
||||||
|
@ -15,7 +17,23 @@ public class Ah6Model extends GeoModel<Ah6Entity> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResourceLocation getModelResource(Ah6Entity entity) {
|
public ResourceLocation getModelResource(Ah6Entity entity) {
|
||||||
|
Player player = Minecraft.getInstance().player;
|
||||||
|
|
||||||
|
int distance = 0;
|
||||||
|
|
||||||
|
if (player != null) {
|
||||||
|
distance = (int) player.position().distanceTo(entity.position());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (distance < 32) {
|
||||||
return ModUtils.loc("geo/ah_6.geo.json");
|
return ModUtils.loc("geo/ah_6.geo.json");
|
||||||
|
} else if (distance < 64) {
|
||||||
|
return ModUtils.loc("geo/ah_6.lod1.geo.json");
|
||||||
|
} else if (distance < 96) {
|
||||||
|
return ModUtils.loc("geo/ah_6.lod2.geo.json");
|
||||||
|
} else {
|
||||||
|
return ModUtils.loc("geo/ah_6.lod3.geo.json");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -3,8 +3,10 @@ package com.atsuishio.superbwarfare.client.model.entity;
|
||||||
import com.atsuishio.superbwarfare.ModUtils;
|
import com.atsuishio.superbwarfare.ModUtils;
|
||||||
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
|
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
|
||||||
import com.atsuishio.superbwarfare.entity.vehicle.AnnihilatorEntity;
|
import com.atsuishio.superbwarfare.entity.vehicle.AnnihilatorEntity;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.util.Mth;
|
import net.minecraft.util.Mth;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
import software.bernie.geckolib.constant.DataTickets;
|
import software.bernie.geckolib.constant.DataTickets;
|
||||||
import software.bernie.geckolib.core.animatable.model.CoreGeoBone;
|
import software.bernie.geckolib.core.animatable.model.CoreGeoBone;
|
||||||
import software.bernie.geckolib.core.animation.AnimationState;
|
import software.bernie.geckolib.core.animation.AnimationState;
|
||||||
|
@ -22,22 +24,19 @@ public class AnnihilatorModel extends GeoModel<AnnihilatorEntity> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResourceLocation getModelResource(AnnihilatorEntity entity) {
|
public ResourceLocation getModelResource(AnnihilatorEntity entity) {
|
||||||
|
Player player = Minecraft.getInstance().player;
|
||||||
|
|
||||||
|
int distance = 0;
|
||||||
|
|
||||||
|
if (player != null) {
|
||||||
|
distance = (int) player.position().distanceTo(entity.position());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (distance < 64) {
|
||||||
return ModUtils.loc("geo/annihilator.geo.json");
|
return ModUtils.loc("geo/annihilator.geo.json");
|
||||||
// Player player = Minecraft.getInstance().player;
|
} else {
|
||||||
//
|
return ModUtils.loc("geo/annihilator.lod1.geo.json");
|
||||||
// int distance = 0;
|
}
|
||||||
//
|
|
||||||
// if (player != null) {
|
|
||||||
// distance = (int) player.position().distanceTo(entity.position());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (distance < 32) {
|
|
||||||
// return ModUtils.loc("geo/sherman.geo.json");
|
|
||||||
// } else if (distance < 64) {
|
|
||||||
// return ModUtils.loc("geo/sherman_lod1.geo.json");
|
|
||||||
// } else {
|
|
||||||
// return ModUtils.loc("geo/sherman_lod2.geo.json");
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -2,7 +2,9 @@ package com.atsuishio.superbwarfare.client.model.entity;
|
||||||
|
|
||||||
import com.atsuishio.superbwarfare.ModUtils;
|
import com.atsuishio.superbwarfare.ModUtils;
|
||||||
import com.atsuishio.superbwarfare.entity.vehicle.SpeedboatEntity;
|
import com.atsuishio.superbwarfare.entity.vehicle.SpeedboatEntity;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
import software.bernie.geckolib.model.GeoModel;
|
import software.bernie.geckolib.model.GeoModel;
|
||||||
|
|
||||||
public class SpeedboatModel extends GeoModel<SpeedboatEntity> {
|
public class SpeedboatModel extends GeoModel<SpeedboatEntity> {
|
||||||
|
@ -14,7 +16,19 @@ public class SpeedboatModel extends GeoModel<SpeedboatEntity> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResourceLocation getModelResource(SpeedboatEntity entity) {
|
public ResourceLocation getModelResource(SpeedboatEntity entity) {
|
||||||
|
Player player = Minecraft.getInstance().player;
|
||||||
|
|
||||||
|
int distance = 0;
|
||||||
|
|
||||||
|
if (player != null) {
|
||||||
|
distance = (int) player.position().distanceTo(entity.position());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (distance < 32) {
|
||||||
return ModUtils.loc("geo/speedboat.geo.json");
|
return ModUtils.loc("geo/speedboat.geo.json");
|
||||||
|
} else {
|
||||||
|
return ModUtils.loc("geo/speedboat.lod1.geo.json");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
4300
src/main/resources/assets/superbwarfare/geo/ah_6.lod1.geo.json
Normal file
4300
src/main/resources/assets/superbwarfare/geo/ah_6.lod1.geo.json
Normal file
File diff suppressed because it is too large
Load diff
2220
src/main/resources/assets/superbwarfare/geo/ah_6.lod2.geo.json
Normal file
2220
src/main/resources/assets/superbwarfare/geo/ah_6.lod2.geo.json
Normal file
File diff suppressed because it is too large
Load diff
1334
src/main/resources/assets/superbwarfare/geo/ah_6.lod3.geo.json
Normal file
1334
src/main/resources/assets/superbwarfare/geo/ah_6.lod3.geo.json
Normal file
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
2685
src/main/resources/assets/superbwarfare/geo/speedboat.lod1.geo.json
Normal file
2685
src/main/resources/assets/superbwarfare/geo/speedboat.lod1.geo.json
Normal file
File diff suppressed because it is too large
Load diff
Binary file not shown.
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Loading…
Add table
Reference in a new issue