Skip to content

Commit 10c2876

Browse files
committed
fix jitpack compile
internal import not found, lets remove it then
1 parent 029a58b commit 10c2876

File tree

12 files changed

+185
-35
lines changed

12 files changed

+185
-35
lines changed

.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#Gradle
2+
.gradle/
3+
build/
4+
out/
5+
classes/
6+
7+
#IDEA
8+
.idea/
9+
*.iml
10+
*.ipr
11+
*.iws
12+
13+
#vscode
14+
.settings/
15+
.vscode/
16+
bin/
17+
.classpath
18+
.project
19+
20+
#fabric
21+
run/
22+
villager

carlsjr.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ yarn_mappings = 1.15.2+build.15
66
loader_version = 0.8.2+build.194
77

88
#Mod properties
9-
mod_version = 1.1.0
9+
mod_version = 1.1.1
1010
maven_group = mod.linguardium
1111
archives_base_name = tradesmen
1212

src/main/java/mod/linguardium/tradesmen/TradesmenClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package mod.linguardium.tradesmen;
22

33
import mod.linguardium.tradesmen.entities.InitEntities;
4+
import mod.linguardium.tradesmen.entities.SecretTradesmenRenderer;
45
import mod.linguardium.tradesmen.entities.TradesmenRenderer;
56
import net.fabricmc.api.ClientModInitializer;
67
import net.fabricmc.fabric.api.client.rendereregistry.v1.EntityRendererRegistry;
@@ -10,5 +11,6 @@ public class TradesmenClient implements ClientModInitializer {
1011
@Override
1112
public void onInitializeClient() {
1213
EntityRendererRegistry.INSTANCE.register(InitEntities.TRADESMEN_ENTITY_TYPE, (entityRenderDispatcher, context) -> new TradesmenRenderer(entityRenderDispatcher));
14+
EntityRendererRegistry.INSTANCE.register(InitEntities.SECRET_TRADESMEN_ENTITY_TYPE, (entityRenderDispatcher, context) -> new SecretTradesmenRenderer(entityRenderDispatcher));
1315
}
1416
}

src/main/java/mod/linguardium/tradesmen/api/TradesmenManager.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package mod.linguardium.tradesmen.api;
22

3-
import jdk.internal.jline.internal.Nullable;
3+
44
import mod.linguardium.tradesmen.Tradesmen;
55
import mod.linguardium.tradesmen.entities.InitEntities;
66
import mod.linguardium.tradesmen.entities.TradesmenEntity;
@@ -109,7 +109,12 @@ private boolean spawnRoamingTrader() {
109109
return false;
110110
}
111111

112-
TradesmenEntity traderEntity = (TradesmenEntity) InitEntities.TRADESMEN_ENTITY_TYPE.spawn(this.world, (CompoundTag)null, (Text)null, (PlayerEntity)null, blockPos3, SpawnType.EVENT, false, false);
112+
TradesmenEntity traderEntity=null;
113+
if ((Tradesmen.getConfig().secrets && world.random.nextInt(1000) < 1)) {
114+
traderEntity = (TradesmenEntity) InitEntities.SECRET_TRADESMEN_ENTITY_TYPE.spawn(this.world, (CompoundTag) null, (Text) null, (PlayerEntity) null, blockPos3, SpawnType.EVENT, false, false);
115+
}else {
116+
traderEntity = (TradesmenEntity) InitEntities.TRADESMEN_ENTITY_TYPE.spawn(this.world, (CompoundTag) null, (Text) null, (PlayerEntity) null, blockPos3, SpawnType.EVENT, false, false);
117+
}
113118
if (traderEntity != null) {
114119
traderEntity.setTraderType(allowedTraderTypes.get(world.random.nextInt(allowedTraderTypes.size())));
115120
for (int i=0;i<getTraderById(traderEntity.getTraderType()).animalCount; i++) {
@@ -139,7 +144,7 @@ private void SpawnAnimal(String AnimalId, TradesmenEntity ownerTrader, int dista
139144
}
140145
}
141146
}
142-
@Nullable
147+
143148
private BlockPos getSpawnableHeight(BlockPos pos, int vDistance) {
144149
for (int y = 0; y < vDistance; y++) {
145150
if (SpawnHelper.canSpawn(SpawnRestriction.Location.ON_GROUND, this.world, pos.add(0,y,0), InitEntities.TRADESMEN_ENTITY_TYPE)) {
@@ -153,7 +158,7 @@ private BlockPos getSpawnableHeight(BlockPos pos, int vDistance) {
153158
}
154159
return null;
155160
}
156-
@Nullable
161+
157162
private BlockPos getPosDistanceFrom(BlockPos blockPos, int distance) {
158163
BlockPos blockPos2 = null;
159164

src/main/java/mod/linguardium/tradesmen/config/ModConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ public class ModConfig implements ConfigData {
1616

1717
@ConfigEntry.BoundedDiscrete(max=100,min=1)
1818
public int spawnChance = 25;
19-
19+
public boolean secrets = false;
2020

2121
}

src/main/java/mod/linguardium/tradesmen/entities/InitEntities.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ public class InitEntities {
1515
new Identifier(Tradesmen.MOD_ID, "tradesmen_seller"),
1616
FabricEntityTypeBuilder.create(EntityCategory.MISC, TradesmenEntity::new).size(EntityDimensions.fixed(0.6F, 1.95F)).build()
1717
);
18+
public static final EntityType<TradesmenEntity> SECRET_TRADESMEN_ENTITY_TYPE =
19+
Registry.register(
20+
Registry.ENTITY_TYPE,
21+
new Identifier(Tradesmen.MOD_ID, "tradesmen_seller_secret"),
22+
FabricEntityTypeBuilder.create(EntityCategory.MISC, TradesmenEntity::new).size(EntityDimensions.fixed(0.6F, 1.95F)).build()
23+
);
1824
public static void init() {
1925

2026
}
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
package mod.linguardium.tradesmen.entities;
2+
3+
import com.google.common.collect.ImmutableList;
4+
import net.minecraft.client.model.ModelPart;
5+
import net.minecraft.client.render.entity.model.CompositeEntityModel;
6+
import net.minecraft.client.render.entity.model.ModelWithHat;
7+
import net.minecraft.client.render.entity.model.ModelWithHead;
8+
import net.minecraft.entity.Entity;
9+
import net.minecraft.entity.passive.AbstractTraderEntity;
10+
import net.minecraft.util.math.MathHelper;
11+
12+
public class SecretTradesmenEntityModel<T extends Entity> extends CompositeEntityModel<T> implements ModelWithHead, ModelWithHat {
13+
protected ModelPart head=null;
14+
protected ModelPart man_torso=null;
15+
protected ModelPart arms=null;
16+
protected ModelPart torso=null;
17+
private ModelPart rightBackLeg=null;
18+
private ModelPart leftBackLeg=null;
19+
private ModelPart rightFrontLeg=null;
20+
private ModelPart leftFrontLeg=null;
21+
protected ModelPart nose=null;
22+
private ModelPart rightChest=null;
23+
private ModelPart leftChest=null;
24+
25+
public SecretTradesmenEntityModel(float scale) {
26+
this(scale, 128, 64);
27+
}
28+
29+
public SecretTradesmenEntityModel(float scale, int textureWidth, int textureHeight) {
30+
float f = 0.7F;
31+
this.head = (new ModelPart(this)).setTextureSize(textureWidth, textureHeight);
32+
this.head.setPivot(0.0F, -10.0F, -5.0F);
33+
this.head.setTextureOffset(0, 0).addCuboid(-4.0F, -10.0F, -4.0F, 8.0F, 10.0F, 8.0F, scale);
34+
this.nose = (new ModelPart(this)).setTextureSize(textureWidth, textureHeight);
35+
this.nose.setPivot(0.0F, -2.0F, 0.0F);
36+
this.nose.setTextureOffset(24, 0).addCuboid(-1.0F, -1.0F, -5.0F, 2.0F, 2.0F, 2.0F, scale);
37+
this.head.addChild(this.nose);
38+
this.man_torso = (new ModelPart(this)).setTextureSize(textureWidth, textureHeight);
39+
this.man_torso.setPivot(0.0F, -7.1F, 15.0F);
40+
// Y = front/back
41+
// Z = Height
42+
// X = Left/right
43+
this.man_torso.setTextureOffset(16, 20).addCuboid(-4.0F, 0.0F, -3.0F, 8.0F, 12.0F, 6.0F, scale);
44+
this.man_torso.pitch=-1.5707964F;
45+
/* this.robe = (new ModelPart(this)).setTextureSize(textureWidth, textureHeight);
46+
this.robe.setPivot(0.0F, 0.0F, 0.0F);
47+
this.robe.setTextureOffset(0, 38).addCuboid(-4.0F, 0.0F, -3.0F, 8.0F, 18.0F, 6.0F, scale + 0.5F);
48+
this.man_torso.addChild(this.robe);*/
49+
this.arms = (new ModelPart(this)).setTextureSize(textureWidth, textureHeight);
50+
this.arms.setTextureOffset(0, 40).addCuboid(-8.0F, -2.0F, -2.0F, 4.0F, 8.0F, 4.0F, scale);
51+
this.arms.setTextureOffset(0, 40).addCuboid(4.0F, -2.0F, -2.0F, 4.0F, 8.0F, 4.0F, scale, true);
52+
this.arms.setTextureOffset(18, 40).addCuboid(-4.0F, 2.0F, -2.0F, 8.0F, 4.0F, 4.0F, scale);
53+
this.arms.setPivot(0.0F, -7.0F, -6.0F);
54+
this.torso = new ModelPart(this, 79, 0).setTextureSize(textureWidth,textureHeight);
55+
this.torso.addCuboid(-6.0F, -10.0F, -7.0F, 12.0F, 18.0F, 10.0F, f);
56+
this.torso.setPivot(0.0F, 5.0F, 2.0F);
57+
this.torso.pitch=1.5707964F;
58+
this.torso.addChild(man_torso);
59+
this.rightChest = new ModelPart(this, 45, 28).setTextureSize(textureWidth,textureHeight);
60+
this.rightChest.addCuboid(-3.0F, 0.0F, 0.0F, 8.0F, 8.0F, 3.0F, f);
61+
this.rightChest.setPivot(-8.5F, 3.0F, 3.0F);
62+
this.rightChest.yaw = 1.5707964F;
63+
this.leftChest = new ModelPart(this, 45, 41).setTextureSize(textureWidth,textureHeight);
64+
this.leftChest.addCuboid(-3.0F, 0.0F, 0.0F, 8.0F, 8.0F, 3.0F, f);
65+
this.leftChest.setPivot(5.5F, 3.0F, 3.0F);
66+
this.leftChest.yaw = 1.5707964F;
67+
this.rightBackLeg = new ModelPart(this, 79, 29).setTextureSize(textureWidth,textureHeight);
68+
this.rightBackLeg.addCuboid(-2.0F, 0.0F, -2.0F, 4.0F, 14.0F, 4.0F, f);
69+
this.rightBackLeg.setPivot(-2.5F, 10.0F, 6.0F);
70+
this.leftBackLeg = new ModelPart(this, 79, 29).setTextureSize(textureWidth,textureHeight);
71+
this.leftBackLeg.addCuboid(-2.0F, 0.0F, -2.0F, 4.0F, 14.0F, 4.0F, f);
72+
this.leftBackLeg.setPivot(2.5F, 10.0F, 6.0F);
73+
this.rightFrontLeg = new ModelPart(this, 79, 29).setTextureSize(textureWidth,textureHeight);
74+
this.rightFrontLeg.addCuboid(-2.0F, 0.0F, -2.0F, 4.0F, 14.0F, 4.0F, f);
75+
this.rightFrontLeg.setPivot(-2.5F, 10.0F, -4.0F);
76+
this.leftFrontLeg = new ModelPart(this, 79, 29).setTextureSize(textureWidth,textureHeight);
77+
this.leftFrontLeg.addCuboid(-2.0F, 0.0F, -2.0F, 4.0F, 14.0F, 4.0F, f);
78+
this.leftFrontLeg.setPivot(2.5F, 10.0F, -4.0F);
79+
--this.rightBackLeg.pivotX;
80+
++this.leftBackLeg.pivotX;
81+
--this.rightFrontLeg.pivotX;
82+
++this.leftFrontLeg.pivotX;
83+
--this.rightFrontLeg.pivotZ;
84+
--this.leftFrontLeg.pivotZ;
85+
}
86+
87+
public Iterable<ModelPart> getParts() {
88+
return ImmutableList.of(this.head, this.torso, this.arms, this.rightBackLeg, this.leftBackLeg, this.rightFrontLeg, this.leftFrontLeg, this.rightChest, this.leftChest);
89+
}
90+
91+
public void setAngles(T entity, float limbAngle, float limbDistance, float customAngle, float headYaw, float headPitch) {
92+
boolean stillRollin = false;
93+
if (entity instanceof AbstractTraderEntity) {
94+
stillRollin = ((AbstractTraderEntity)entity).getHeadRollingTimeLeft() > 0;
95+
}
96+
97+
this.head.yaw = headYaw * 0.017453292F;
98+
this.head.pitch = headPitch * 0.017453292F;
99+
if (stillRollin) {
100+
this.head.roll = 0.3F * MathHelper.sin(0.45F * customAngle);
101+
this.head.pitch = 0.4F;
102+
} else {
103+
this.head.roll = 0.0F;
104+
}
105+
this.arms.pitch = -0.75F;
106+
this.rightBackLeg.pitch = MathHelper.cos(limbAngle * 0.6662F) * 1.4F * limbDistance;
107+
this.leftBackLeg.pitch = MathHelper.cos(limbAngle * 0.6662F + 3.1415927F) * 1.4F * limbDistance;
108+
this.rightFrontLeg.pitch = MathHelper.cos(limbAngle * 0.6662F + 3.1415927F) * 1.4F * limbDistance;
109+
this.leftFrontLeg.pitch = MathHelper.cos(limbAngle * 0.6662F) * 1.4F * limbDistance;
110+
this.rightChest.visible = true;
111+
this.leftChest.visible = true;
112+
}
113+
114+
public ModelPart getHead() {
115+
return this.head;
116+
}
117+
118+
public void setHatVisible(boolean visible) {
119+
this.head.visible = visible;
120+
}
121+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package mod.linguardium.tradesmen.entities;
2+
3+
import net.minecraft.client.render.entity.EntityRenderDispatcher;
4+
import net.minecraft.client.render.entity.MobEntityRenderer;
5+
import net.minecraft.util.Identifier;
6+
7+
public class SecretTradesmenRenderer extends MobEntityRenderer<TradesmenEntity, SecretTradesmenEntityModel<TradesmenEntity>> {
8+
9+
public SecretTradesmenRenderer(EntityRenderDispatcher renderManager) {
10+
super(renderManager, new SecretTradesmenEntityModel<>(0.0F), 0.5F);
11+
//this.addFeature(new TradesmenClothingFeatureRenderer(this));
12+
}
13+
14+
@Override
15+
public Identifier getTexture(TradesmenEntity entity) {
16+
return new Identifier("tradesmen:textures/entity/black_llaman.png");
17+
}
18+
19+
}

src/main/java/mod/linguardium/tradesmen/entities/TradesmenEntity.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package mod.linguardium.tradesmen.entities;
22

3-
import jdk.internal.jline.internal.Nullable;
3+
44
import mod.linguardium.tradesmen.Tradesmen;
55
import mod.linguardium.tradesmen.api.TradesmenManager;
66
import net.minecraft.entity.Entity;
@@ -43,7 +43,6 @@ public class TradesmenEntity extends WanderingTraderEntity {
4343
private static final TrackedData<Integer> TRADER_TIER = DataTracker.registerData(TradesmenEntity.class, TrackedDataHandlerRegistry.INTEGER);;
4444
private static final TrackedData<CompoundTag> TRADER_SPAWNED_ANIMAL= DataTracker.registerData(TradesmenEntity.class, TrackedDataHandlerRegistry.TAG_COMPOUND);;
4545
private int despawnDelay;
46-
@Nullable
4746
private BlockPos wanderTarget;
4847

4948
public TradesmenEntity(EntityType<? extends WanderingTraderEntity> entityType, World world) {
@@ -217,7 +216,7 @@ private void tickDespawnDelay() {
217216

218217
}
219218

220-
@Nullable
219+
221220
private BlockPos getWanderTarget() {
222221
return this.wanderTarget;
223222
}

0 commit comments

Comments
 (0)