use of net.minecraft.util.Identifier in project SeedcrackerX by 19MisterX98.
the class ConfigScreen method getConfigScreenByCloth.
public Screen getConfigScreenByCloth(Screen parent) {
ConfigBuilder builder = ConfigBuilder.create().setParentScreen(parent).setTitle(new TranslatableText("title")).setDefaultBackgroundTexture(new Identifier("minecraft:textures/block/blackstone.png")).setTransparentBackground(true);
ConfigEntryBuilder eb = builder.entryBuilder();
// =============================CONFIG========================
ConfigCategory settings = builder.getOrCreateCategory(new TranslatableText("settings"));
settings.addEntry(eb.startBooleanToggle(new TranslatableText("settings.active"), config.active).setSaveConsumer(val -> config.active = val).build());
settings.addEntry(eb.startBooleanToggle(new TranslatableText("settings.database"), config.databaseSubmits).setTooltip(new TranslatableText("settings.database.tooltip")).setSaveConsumer(val -> config.databaseSubmits = val).build());
settings.addEntry(eb.startBooleanToggle(new TranslatableText("settings.hideNameDatabase"), config.anonymusSubmits).setSaveConsumer(val -> config.anonymusSubmits = val).build());
settings.addEntry(eb.startDropdownMenu(new TranslatableText("settings.version"), DropdownMenuBuilder.TopCellElementBuilder.of(config.getVersion(), MCVersion::fromString)).setSelections(getSupportedVersions()).setSuggestionMode(false).setDefaultValue(config.getVersion()).setSaveConsumer(config::setVersion).build());
settings.addEntry(eb.startTextDescription(new LiteralText("==============")).build());
settings.addEntry(eb.startTextDescription(new TranslatableText("settings.visuals")).build());
settings.addEntry(eb.startEnumSelector(new TranslatableText("settings.outline"), Config.RenderType.class, config.render).setSaveConsumer(val -> config.render = val).build());
settings.addEntry(eb.startTextDescription(new LiteralText("==============")).build());
settings.addEntry(eb.startTextDescription((new TranslatableText("settings.finderToggles"))).build());
for (Finder.Type finder : Finder.Type.values()) {
settings.addEntry(eb.startBooleanToggle(new TranslatableText(finder.nameKey), finder.enabled.get()).setSaveConsumer(val -> finder.enabled.set(val)).build());
}
settings.addEntry(eb.startTextDescription(new LiteralText("==============")).build());
settings.addEntry(eb.startBooleanToggle(new TranslatableText("settings.antiXrayMode"), config.antiXrayBypass).setSaveConsumer(val -> config.antiXrayBypass = val).build());
settings.addEntry(eb.startTextDescription(new TranslatableText("settings.antiAntiXrayExplained")).build());
// =============================INFO========================
ConfigCategory info = builder.getOrCreateCategory(new TranslatableText("info"));
// Clear data
info.addEntry(eb.startBooleanToggle(new TranslatableText("info.clearData"), false).setSaveConsumer(val -> {
if (val) {
SeedCracker.get().reset();
}
}).build());
// List worldseeds
Set<Long> worldSeeds = SeedCracker.get().getDataStorage().getTimeMachine().worldSeeds;
if (!worldSeeds.isEmpty()) {
SubCategoryBuilder world = eb.startSubCategory(new TranslatableText("info.worldSeeds"));
for (long worldSeed : worldSeeds) {
world.add(eb.startTextField(new LiteralText(""), String.valueOf(worldSeed)).build());
}
info.addEntry(world.setExpanded(true).build());
} else {
info.addEntry(eb.startTextDescription(new TranslatableText("info.noWorldSeeds")).build());
}
// List structureseeds
Set<Long> structureSeeds = SeedCracker.get().getDataStorage().getTimeMachine().structureSeeds;
if (!structureSeeds.isEmpty()) {
SubCategoryBuilder struc = eb.startSubCategory(new TranslatableText("info.structureSeeds"));
for (long structureSeed : structureSeeds) {
struc.add(eb.startTextField(new LiteralText(""), String.valueOf(structureSeed)).build());
}
info.addEntry(struc.setExpanded(true).build());
} else {
info.addEntry(eb.startTextDescription(new TranslatableText("info.noStructureSeeds")).build());
}
if (config.debug) {
// List pillarseeds
List<Integer> pillarSeeds = SeedCracker.get().getDataStorage().getTimeMachine().pillarSeeds;
if (pillarSeeds != null) {
SubCategoryBuilder pillar = eb.startSubCategory(new TranslatableText("info.pillarSeeds"));
for (long structureSeed : pillarSeeds) {
pillar.add(eb.startTextField(new LiteralText(""), String.valueOf(structureSeed)).build());
}
info.addEntry(pillar.setExpanded(true).build());
} else {
info.addEntry(eb.startTextDescription(new TranslatableText("info.noPillarSeeds")).build());
}
// Hashed seed
HashedSeedData hashedSeed = SeedCracker.get().getDataStorage().hashedSeedData;
if (hashedSeed != null) {
info.addEntry(eb.startTextField(new TranslatableText("info.hashedSeed"), String.valueOf(hashedSeed.getHashedSeed())).build());
} else {
info.addEntry(eb.startTextDescription(new TranslatableText("info.noHashedSeed")).build());
}
}
builder.setSavingRunnable(Config::save);
return builder.build();
}
use of net.minecraft.util.Identifier in project wildmod by Osmiooo.
the class MangroveBoatEntityRenderer method render.
public void render(MangroveBoatEntity boatEntity, float f, float g, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i) {
matrixStack.push();
matrixStack.translate(0.0D, 0.375D, 0.0D);
matrixStack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(180.0F - f));
float h = (float) boatEntity.getDamageWobbleTicks() - g;
float j = boatEntity.getDamageWobbleStrength() - g;
if (j < 0.0F) {
j = 0.0F;
}
if (h > 0.0F) {
matrixStack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(MathHelper.sin(h) * h * j / 10.0F * (float) boatEntity.getDamageWobbleSide()));
}
float k = boatEntity.interpolateBubbleWobble(g);
if (!MathHelper.approximatelyEquals(k, 0.0F)) {
matrixStack.multiply(new Quaternion(new Vec3f(1.0F, 0.0F, 1.0F), boatEntity.interpolateBubbleWobble(g), true));
}
Identifier texture = this.texture;
MangroveBoatEntityModel model = this.model;
Identifier identifier = texture;
MangroveBoatEntityModel boatEntityModel = model;
matrixStack.scale(-1.0F, -1.0F, 1.0F);
matrixStack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(90.0F));
boatEntityModel.setAngles(boatEntity, g, 0.0F, -0.1F, 0.0F, 0.0F);
VertexConsumer vertexConsumer = vertexConsumerProvider.getBuffer(boatEntityModel.getLayer(identifier));
boatEntityModel.render(matrixStack, vertexConsumer, i, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F);
if (!boatEntity.isSubmergedInWater()) {
VertexConsumer vertexConsumer2 = vertexConsumerProvider.getBuffer(RenderLayer.getWaterMask());
boatEntityModel.getWaterPatch().render(matrixStack, vertexConsumer2, i, OverlayTexture.DEFAULT_UV);
}
matrixStack.pop();
super.render(boatEntity, f, g, matrixStack, vertexConsumerProvider, i);
}
use of net.minecraft.util.Identifier in project wildmod by Osmiooo.
the class SimpleGameEventDispatcherMixin method dispatch.
@Inject(at = @At("HEAD"), method = "dispatch")
private void dispatch(GameEvent event, Entity entity, BlockPos pos, CallbackInfo ci) {
BlockPos eventpos;
World eventworld;
LivingEntity evententity;
if (SculkSensorBlock.FREQUENCIES.containsKey(event)) {
if (entity == null) {
eventpos = pos;
eventworld = this.world;
evententity = null;
} else {
if (entity.getType() == EntityType.PLAYER) {
if (event == GameEvent.STEP || event == GameEvent.HIT_GROUND || event == GameEvent.PROJECTILE_SHOOT) {
if (entity.isSneaking()) {
eventpos = null;
eventworld = null;
evententity = null;
} else {
PlayerEntity player = (PlayerEntity) entity;
Item booties = player.getEquippedStack(EquipmentSlot.FEET).getItem();
Identifier identity = Registry.ITEM.getId(booties);
if (new Identifier("wooledboots", "wooled_chainmail_boots").equals(identity) || new Identifier("wooledboots", "wooled_gold_boots").equals(identity) || new Identifier("wooledboots", "wooled_diamond_boots").equals(identity) || new Identifier("wooledboots", "wooled_netherite_boots").equals(identity) || new Identifier("wooledboots", "wooled_iron_boots").equals(identity)) {
eventpos = null;
eventworld = null;
evententity = null;
} else {
eventpos = pos;
eventworld = entity.getEntityWorld();
evententity = (LivingEntity) entity;
}
}
} else {
eventpos = pos;
eventworld = entity.getEntityWorld();
evententity = (LivingEntity) entity;
}
} else if (entity.getType() != RegisterEntities.WARDEN) {
eventpos = pos;
eventworld = entity.getEntityWorld();
if (entity.isLiving()) {
evententity = (LivingEntity) entity;
} else {
evententity = null;
}
} else {
eventpos = null;
eventworld = null;
evententity = null;
}
}
boolean bl1 = evententity != null || event == GameEvent.EAT || event == GameEvent.HIT_GROUND;
if (eventpos != null && eventworld != null && bl1) {
List<WardenEntity> wardens = this.world.getNonSpectatingEntities(WardenEntity.class, new Box(eventpos.getX() - 18, eventpos.getY() - 18, eventpos.getZ() - 18, eventpos.getX() + 18, eventpos.getY() + 18, eventpos.getZ() + 18));
Iterator<WardenEntity> var11 = wardens.iterator();
WardenEntity wardie;
while (var11.hasNext()) {
wardie = var11.next();
// System.out.println(Math.floor(Math.sqrt(wardie.getBlockPos().getSquaredDistance(eventpos, false))));
if (wardie.getEntityWorld() == eventworld && Math.floor(Math.sqrt(wardie.getBlockPos().getSquaredDistance(eventpos, false))) <= 16) {
boolean bl2 = event == GameEvent.HIT_GROUND && evententity == null;
if (event != GameEvent.PROJECTILE_LAND && event != GameEvent.EAT && !bl2) {
wardie.listen(eventpos, eventworld, evententity, wardie.eventSuspicionValue(event, evententity), null);
} else {
wardie.listen(eventpos, eventworld, null, 0, null);
}
}
}
}
}
}
use of net.minecraft.util.Identifier in project wildmod by Osmiooo.
the class RegisterAccurateSculk method RegisterAccurateSculk.
public static void RegisterAccurateSculk() {
Registry.register(Registry.POSITION_SOURCE_TYPE, new Identifier(WildMod.MOD_ID, "warden_source"), WARDEN);
Registry.register(Registry.GAME_EVENT, new Identifier(WildMod.MOD_ID, "click"), CLICK);
Registry.register(Registry.GAME_EVENT, new Identifier(WildMod.MOD_ID, "death"), DEATH);
Registry.register(Registry.PARTICLE_TYPE, new Identifier(WildMod.MOD_ID, "sculk_shriek"), SCULK_SHRIEK);
Registry.register(Registry.PARTICLE_TYPE, new Identifier(WildMod.MOD_ID, "sculk_shriek2"), SCULK_SHRIEK2);
Registry.register(Registry.PARTICLE_TYPE, new Identifier(WildMod.MOD_ID, "sculk_shriekz"), SCULK_SHRIEKZ);
Registry.register(Registry.PARTICLE_TYPE, new Identifier(WildMod.MOD_ID, "sculk_shriekz2"), SCULK_SHRIEKZ2);
Registry.register(Registry.PARTICLE_TYPE, new Identifier(WildMod.MOD_ID, "sculk_shrieknx"), SCULK_SHRIEKNX);
Registry.register(Registry.PARTICLE_TYPE, new Identifier(WildMod.MOD_ID, "sculk_shrieknx2"), SCULK_SHRIEKNX2);
Registry.register(Registry.PARTICLE_TYPE, new Identifier(WildMod.MOD_ID, "sculk_shriekx"), SCULK_SHRIEKX);
Registry.register(Registry.PARTICLE_TYPE, new Identifier(WildMod.MOD_ID, "sculk_shriekx2"), SCULK_SHRIEKX2);
Registry.register(Registry.SOUND_EVENT, RegisterAccurateSculk.GARGLE, GARGLE_EVENT);
NewBlockEntityType.init();
}
use of net.minecraft.util.Identifier in project wildmod by Osmiooo.
the class RegisterItems method RegisterItems.
public static void RegisterItems() {
Registry.register(Registry.ITEM, new Identifier(WildMod.MOD_ID, "warden_spawn_egg"), WARDEN_SPAWN_EGG);
Registry.register(Registry.ITEM, new Identifier(WildMod.MOD_ID, "allay_spawn_egg"), ALLAY_SPAWN_EGG);
Registry.register(Registry.ITEM, new Identifier(WildMod.MOD_ID, "frog_spawn_egg"), FROG_SPAWN_EGG);
Registry.register(Registry.ITEM, new Identifier(WildMod.MOD_ID, "tadpole_bucket"), TADPOLE_BUCKET);
Registry.register(Registry.ITEM, new Identifier(WildMod.MOD_ID, "tadpole_spawn_egg"), TADPOLE_SPAWN_EGG);
Registry.register(Registry.ITEM, new Identifier(WildMod.MOD_ID, "firefly_spawn_egg"), FIREFLY_SPAWN_EGG);
Registry.register(Registry.ITEM, new Identifier(WildMod.MOD_ID, "mangrove_boat"), MANGROVE_BOAT);
Registry.register(Registry.ITEM, new Identifier(WildMod.MOD_ID, "oak_chest_boat"), OAK_CHEST_BOAT);
Registry.register(Registry.ITEM, new Identifier(WildMod.MOD_ID, "spruce_chest_boat"), SPRUCE_CHEST_BOAT);
Registry.register(Registry.ITEM, new Identifier(WildMod.MOD_ID, "birch_chest_boat"), BIRCH_CHEST_BOAT);
Registry.register(Registry.ITEM, new Identifier(WildMod.MOD_ID, "jungle_chest_boat"), JUNGLE_CHEST_BOAT);
Registry.register(Registry.ITEM, new Identifier(WildMod.MOD_ID, "acacia_chest_boat"), ACACIA_CHEST_BOAT);
Registry.register(Registry.ITEM, new Identifier(WildMod.MOD_ID, "dark_oak_chest_boat"), DARK_OAK_CHEST_BOAT);
Registry.register(Registry.ITEM, new Identifier(WildMod.MOD_ID, "mangrove_chest_boat"), MANGROVE_CHEST_BOAT);
}
Aggregations