use of org.spongepowered.asm.mixin.Unique in project fabric by Legacy-Fabric.
the class CrashReportMixin method getFabricMods.
@Unique
public String getFabricMods() {
Map<String, String> mods = new TreeMap<>();
for (ModContainer container : FabricLoader.getInstance().getAllMods()) {
mods.put(container.getMetadata().getId(), container.getMetadata().getName() + " " + container.getMetadata().getVersion().getFriendlyString());
}
StringBuilder modString = new StringBuilder();
for (String id : mods.keySet()) {
modString.append("\n\t\t");
modString.append(id);
modString.append(": ");
modString.append(mods.get(id));
}
return modString.toString();
}
use of org.spongepowered.asm.mixin.Unique in project Porting-Lib by Fabricators-of-Create.
the class Matrix4fMixin method multiplyBackward.
@Unique
@Override
public void multiplyBackward(Matrix4f other) {
Matrix4f copy = other.copy();
copy.multiply((Matrix4f) (Object) this);
this.load(copy);
}
use of org.spongepowered.asm.mixin.Unique in project frex by vram-guild.
the class MixinRenderChunkRegion method frx_cachedAoLevel.
@Unique
@Override
public int frx_cachedAoLevel(int packedSectionPos) {
int result = aoLevelCache.get(packedSectionPos);
if (result == Integer.MAX_VALUE) {
final var pos = frx_sectionPosToSearchPos(packedSectionPos);
final var blockView = (RenderChunkRegion) (Object) this;
final BlockState state = blockView.getBlockState(pos);
if (state.getLightEmission() == 0) {
result = Math.round(255f * state.getShadeBrightness(blockView, pos));
} else {
result = 255;
}
aoLevelCache.put(packedSectionPos, result);
}
return result;
}
use of org.spongepowered.asm.mixin.Unique in project frex by vram-guild.
the class MixinModelBakery method frx_addModel.
@Override
@Unique
public void frx_addModel(ResourceLocation id) {
if (id instanceof ModelResourceLocation) {
loadTopLevel((ModelResourceLocation) id);
} else {
// The vanilla addModel method is arbitrarily limited to ModelIdentifiers,
// but it's useful to tell the game to just load and bake a direct model path as well.
// Replicate the vanilla logic of addModel here.
final UnbakedModel unbakedModel = getModel(id);
this.unbakedCache.put(id, unbakedModel);
this.topLevelModels.put(id, unbakedModel);
}
}
use of org.spongepowered.asm.mixin.Unique in project VisualOverhaul by TeamMidnightDust.
the class MixinJukeboxBlock method tick.
@Unique
private static void tick(World world, BlockPos pos, BlockState state, JukeboxBlockEntity blockEntity) {
if (!world.isClient && (JukeboxPacketUpdate.invUpdate || world.getPlayers().size() == JukeboxPacketUpdate.playerUpdate)) {
Stream<ServerPlayerEntity> watchingPlayers = PlayerLookup.tracking(blockEntity).stream();
PacketByteBuf passedData = new PacketByteBuf(Unpooled.buffer());
passedData.writeBlockPos(pos);
passedData.writeItemStack(blockEntity.getRecord());
watchingPlayers.forEach(player -> ServerSidePacketRegistryImpl.INSTANCE.sendToPlayer(player, VisualOverhaul.UPDATE_RECORD, passedData));
JukeboxPacketUpdate.invUpdate = false;
}
JukeboxPacketUpdate.playerUpdate = world.getPlayers().size();
}
Aggregations